Ejemplo n.º 1
0
 @Override
 public int encode(Cell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out)
     throws IOException {
   BufferedDataBlockEncodingState state =
       (BufferedDataBlockEncodingState) encodingCtx.getEncodingState();
   int encodedKvSize = internalEncode(cell, (HFileBlockDefaultEncodingContext) encodingCtx, out);
   state.unencodedDataSizeWritten += encodedKvSize;
   return encodedKvSize;
 }
Ejemplo n.º 2
0
 @Override
 public void endBlockEncoding(
     HFileBlockEncodingContext encodingCtx,
     DataOutputStream out,
     byte[] uncompressedBytesWithHeader)
     throws IOException {
   BufferedDataBlockEncodingState state =
       (BufferedDataBlockEncodingState) encodingCtx.getEncodingState();
   // Write the unencodedDataSizeWritten (with header size)
   Bytes.putInt(
       uncompressedBytesWithHeader,
       HConstants.HFILEBLOCK_HEADER_SIZE + DataBlockEncoding.ID_SIZE,
       state.unencodedDataSizeWritten);
   if (encodingCtx.getDataBlockEncoding() != DataBlockEncoding.NONE) {
     encodingCtx.postEncoding(BlockType.ENCODED_DATA);
   } else {
     encodingCtx.postEncoding(BlockType.DATA);
   }
 }