Class CellBlockBuilder

java.lang.Object
org.apache.hadoop.hbase.ipc.CellBlockBuilder

@Private class CellBlockBuilder extends Object
Helper class for building cell block.
  • Field Details

  • Constructor Details

    • CellBlockBuilder

      public CellBlockBuilder(org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • buildCellBlock

      public ByteBuffer buildCellBlock(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner) throws IOException
      Puts CellScanner Cells into a cell block using passed in codec and/or compressor.
      Returns:
      Null or byte buffer filled with a cellblock filled with passed-in Cells encoded using passed in codec and/or compressor; the returned buffer has been flipped and is ready for reading. Use limit to find total size.
      Throws:
      IOException
    • buildCellBlock

      public org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf buildCellBlock(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner, org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator alloc) throws IOException
      Throws:
      IOException
    • buildCellBlock

      private boolean buildCellBlock(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner, CellBlockBuilder.OutputStreamSupplier supplier) throws IOException
      Throws:
      IOException
    • encodeCellsTo

      private void encodeCellsTo(OutputStream os, CellScanner cellScanner, Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor) throws IOException
      Throws:
      IOException
    • buildCellBlockStream

      public ByteBufferListOutputStream buildCellBlockStream(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellScanner cellScanner, ByteBuffAllocator allocator) throws IOException
      Puts CellScanner Cells into a cell block using passed in codec and/or compressor.
      Parameters:
      codec - to use for encoding
      compressor - to use for encoding
      cellScanner - to encode
      allocator - to allocate the ByteBuff.
      Returns:
      Null or byte buffer filled with a cellblock filled with passed-in Cells encoded using passed in codec and/or compressor; the returned buffer has been flipped and is ready for reading. Use limit to find total size. If pool was not null, then this returned ByteBuffer came from there and should be returned to the pool when done.
      Throws:
      IOException - if encoding the cells fail
    • createCellScanner

      public CellScanner createCellScanner(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, byte[] cellBlock) throws IOException
      Create a cell scanner.
      Parameters:
      codec - to use for cellblock
      cellBlock - to encode
      Returns:
      CellScanner to work against the content of cellBlock
      Throws:
      IOException - if encoding fails
    • createCellScannerReusingBuffers

      public CellScanner createCellScannerReusingBuffers(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, ByteBuff cellBlock) throws IOException
      Create a cell scanner using an existing bytebuff.
      Parameters:
      codec - to use for cellblock
      cellBlock - ByteBuffer containing the cells written by the Codec. The buffer should be position()'ed at the start of the cell block and limit()'ed at the end.
      Returns:
      CellScanner to work against the content of cellBlock. All cells created out of the CellScanner will share the same ByteBuffer being passed.
      Throws:
      IOException - if cell encoding fails
    • decompress

      private ByteBuffer decompress(org.apache.hadoop.io.compress.CompressionCodec compressor, byte[] compressedCellBlock) throws IOException
      Throws:
      IOException
    • decompress

      private ByteBuff decompress(org.apache.hadoop.io.compress.CompressionCodec compressor, ByteBuff compressedCellBlock) throws IOException
      Throws:
      IOException
    • decompress

      private ByteBuffer decompress(org.apache.hadoop.io.compress.CompressionCodec compressor, InputStream cellBlockStream, int osInitialSize) throws IOException
      Throws:
      IOException