List of usage examples for org.apache.hadoop.io BytesWritable BytesWritable
public BytesWritable(byte[] bytes, int length)
From source file:org.apache.kylin.job.hadoop.cardinality.ColumnCardinalityMapper.java
License:Apache License
@Override protected void cleanup(Context context) throws IOException, InterruptedException { Iterator<Integer> it = hllcMap.keySet().iterator(); while (it.hasNext()) { int key = it.next(); HyperLogLogPlusCounter hllc = hllcMap.get(key); ByteBuffer buf = ByteBuffer.allocate(RowConstants.ROWVALUE_BUFFER_SIZE); buf.clear();// w w w . j av a2s. c o m hllc.writeRegisters(buf); buf.flip(); context.write(new IntWritable(key), new BytesWritable(buf.array(), buf.limit())); } }
From source file:org.apache.kylin.source.hive.cardinality.ColumnCardinalityMapper.java
License:Apache License
@Override protected void doCleanup(Context context) throws IOException, InterruptedException { Iterator<Integer> it = hllcMap.keySet().iterator(); ByteBuffer buf = ByteBuffer.allocate(BufferedMeasureCodec.DEFAULT_BUFFER_SIZE); while (it.hasNext()) { int key = it.next(); HLLCounter hllc = hllcMap.get(key); buf.clear();/* w w w. j av a2 s . c om*/ hllc.writeRegisters(buf); buf.flip(); context.write(new IntWritable(key), new BytesWritable(buf.array(), buf.limit())); } }