Uses of Class
org.apache.hadoop.hbase.nio.ByteBuff
Package
Description
Provides implementations of
HFile
and HFile
BlockCache
.Provides
BucketCache
, an implementation of
BlockCache
.Tools to help define network clients and servers.
-
Uses of ByteBuff in org.apache.hadoop.hbase.codec
Modifier and TypeFieldDescriptionprotected final ByteBuff
KeyValueCodec.ByteBuffKeyValueDecoder.buf
Modifier and TypeMethodDescriptionCellCodec.getDecoder
(ByteBuff buf) CellCodecWithTags.getDecoder
(ByteBuff buf) Codec.getDecoder
(ByteBuff buf) KeyValueCodec.getDecoder
(ByteBuff buf) KeyValueCodecWithTags.getDecoder
(ByteBuff buf) MessageCodec.getDecoder
(ByteBuff buf) ModifierConstructorDescription -
Uses of ByteBuff in org.apache.hadoop.hbase.io
Modifier and TypeMethodDescriptionByteBuffAllocator.allocate
(int size) Allocate size bytes from the ByteBufAllocator, Note to call therelease()
if no need any more, otherwise the memory leak happen in NIO ByteBuffer pool.Modifier and TypeMethodDescriptionvoid
ByteArrayOutputStream.toByteBuff
(ByteBuff buff) int
TagCompressionContext.uncompressTags
(ByteBuff src, byte[] dest, int offset, int length) Uncompress tags from the input ByteBuffer and writes to the destination array. -
Uses of ByteBuff in org.apache.hadoop.hbase.io.encoding
Modifier and TypeFieldDescriptionprotected ByteBuff
BufferedDataBlockEncoder.BufferedEncodedSeeker.currentBuffer
protected ByteBuff
BufferedDataBlockEncoder.SeekerState.currentBuffer
private ByteBuff
RowIndexSeekerV1.currentBuffer
protected ByteBuff
RowIndexSeekerV1.SeekerState.currentBuffer
private ByteBuff
RowIndexSeekerV1.rowOffsets
Modifier and TypeMethodDescriptionCopyKeyDataBlockEncoder.getFirstKeyCellInBlock
(ByteBuff block) DataBlockEncoder.getFirstKeyCellInBlock
(ByteBuff block) Return first key in block as a cell.DiffKeyDeltaEncoder.getFirstKeyCellInBlock
(ByteBuff block) FastDiffDeltaEncoder.getFirstKeyCellInBlock
(ByteBuff block) PrefixKeyDeltaEncoder.getFirstKeyCellInBlock
(ByteBuff block) RowIndexCodecV1.getFirstKeyCellInBlock
(ByteBuff block) void
HFileBlockDecodingContext.prepareDecoding
(int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, ByteBuff blockBufferWithoutHeader, ByteBuff onDiskBlock) Perform all actions that need to be done before the encoder's real decoding process.void
HFileBlockDefaultDecodingContext.prepareDecoding
(int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, ByteBuff blockBufferWithoutHeader, ByteBuff onDiskBlock) void
BufferedDataBlockEncoder.BufferedEncodedSeeker.setCurrentBuffer
(ByteBuff buffer) void
DataBlockEncoder.EncodedSeeker.setCurrentBuffer
(ByteBuff buffer) Set on which buffer there will be done seeking.void
RowIndexSeekerV1.setCurrentBuffer
(ByteBuff buffer) -
Uses of ByteBuff in org.apache.hadoop.hbase.io.hfile
Modifier and TypeFieldDescriptionprivate ByteBuff
HFileReaderImpl.HFileScannerImpl.blockBuffer
(package private) final ByteBuff
HFileBlock.PrefetchedHeader.buf
private ByteBuff
HFileBlockBuilder.buf
private ByteBuff
HFileBlock.bufWithoutChecksum
The in-memory representation of the hfile block.Modifier and TypeMethodDescriptionprivate ByteBuff
HFileBlock.FSReaderImpl.allocate
(int size, boolean intoHeap) private ByteBuff
HFileBlock.allocateBufferForUnpacking()
Always allocates a new buffer of the correct size.private ByteBuff
HFileBlock.Writer.cloneOnDiskBufferWithHeader()
Clones the header followed by the on-disk (compressed/encoded/encrypted) data.(package private) ByteBuff
HFileBlock.Writer.cloneUncompressedBufferWithHeader()
Clones the header followed by the uncompressed data, even if using compression.HFileBlock.getBufferReadOnly()
Returns a read-only duplicate of the buffer this block stores internally ready to be read.HFileBlock.getBufferWithoutHeader()
Returns a buffer that does not include the header and checksum.private ByteBuff
HFileBlock.FSReaderImpl.getCachedHeader
(long offset) Check atomic reference cache for this block's header.private ByteBuff
HFileReaderImpl.EncodedScanner.getEncodedBuffer
(HFileBlock newBlock) Modifier and TypeMethodDescription(package private) static int
HFileBlockIndex.BlockIndexReader.binarySearchNonRootIndex
(Cell key, ByteBuff nonRootIndex, CellComparator comparator) Performs a binary search over a non-root level index block.private void
HFileBlock.FSReaderImpl.cacheNextBlockHeader
(long offset, ByteBuff onDiskBlock, int onDiskSizeWithHeader, int headerLength) Save away the next blocks header in atomic reference.boolean
boolean
private boolean
CompoundBloomFilter.containsInternal
(byte[] key, int keyOffset, int keyLength, ByteBuff bloom) private boolean
CompoundBloomFilter.containsInternal
(Cell keyCell, ByteBuff bloom, BloomType type) private static HFileBlockBuilder
HFileBlock.createBuilder
(HFileBlock blk, ByteBuff newBuff) Creates a new HFileBlockBuilder from the existing block and a new ByteBuff.(package private) static HFileBlock
HFileBlock.createFromBuff
(ByteBuff buf, boolean usesHBaseChecksum, long offset, int nextBlockOnDiskSize, HFileContext fileContext, ByteBuffAllocator allocator) Creates a block from an existing buffer starting with a header.CacheableDeserializer.deserialize
(ByteBuff b, ByteBuffAllocator allocator) HFileBlock.BlockDeserializer.deserialize
(ByteBuff buf, ByteBuffAllocator alloc) private int
HFileBlock.FSReaderImpl.getNextBlockOnDiskSize
(ByteBuff onDiskBlock, int onDiskSizeWithHeader) (package private) static byte[]
HFileBlockIndex.BlockIndexReader.getNonRootIndexedKey
(ByteBuff nonRootIndex, int i) The indexed key at the ith position in the nonRootIndex.private static int
HFileBlock.getOnDiskSizeWithHeader
(ByteBuff headerBuf, boolean checksumSupport) Parse total on disk size including header and checksum.(package private) static int
HFileBlockIndex.BlockIndexReader.locateNonRootIndexEntry
(ByteBuff nonRootBlock, Cell key, CellComparator comparator) Search for one key using the secondary index in a non-root block.private void
HFileBlock.Writer.putHeader
(ByteBuff buff, int onDiskSize, int uncompressedSize, int onDiskDataSize) static BlockType
protected boolean
HFileBlock.FSReaderImpl.readAtOffset
(org.apache.hadoop.fs.FSDataInputStream istream, ByteBuff dest, int size, boolean peekIntoNextBlock, long fileOffset, boolean pread) Does a positional read or a seek and read into the given byte buffer.private static HFileBlock
HFileBlock.shallowClone
(HFileBlock blk, ByteBuff newBuf) (package private) static String
HFileBlock.toStringHeader
(ByteBuff buf) Convert the contents of the block header into a human readable string.(package private) static boolean
ChecksumUtil.validateChecksum
(ByteBuff buf, String pathName, long offset, int hdrSize) Validates that the data in the specified HFileBlock matches the checksum.private boolean
HFileBlock.FSReaderImpl.validateChecksum
(long offset, ByteBuff data, int hdrSize) Generates the checksum for the header as well as the data and then validates it.private static boolean
ChecksumUtil.verifyChunkedSums
(org.apache.hadoop.util.DataChecksum dataChecksum, ByteBuff data, ByteBuff checksums, String pathName) Like the hadoop'sDataChecksum.verifyChunkedSums(ByteBuffer, ByteBuffer, String, long)
, this method will also verify checksum of each chunk in data.HFileBlockBuilder.withByteBuff
(ByteBuff buf) void
ModifierConstructorDescription(package private)
ExclusiveMemHFileBlock
(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator alloc) HFileBlock
(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator allocator) Creates a newHFile
block from the given fields.(package private)
SharedMemHFileBlock
(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator alloc) -
Uses of ByteBuff in org.apache.hadoop.hbase.io.hfile.bucket
Modifier and TypeMethodDescriptionint
FileIOEngine.FileAccessor.access
(FileChannel fileChannel, ByteBuff buff, long accessOffset) int
FileIOEngine.FileReadAccessor.access
(FileChannel fileChannel, ByteBuff buff, long accessOffset) int
FileIOEngine.FileWriteAccessor.access
(FileChannel fileChannel, ByteBuff buff, long accessOffset) private void
FileIOEngine.accessFile
(FileIOEngine.FileAccessor accessor, ByteBuff buff, long globalOffset) (package private) Cacheable
BucketEntry.wrapAsCacheable
(ByteBuff buf) void
Transfers data from the givenByteBuff
to the buffer array.void
void
void
Transfers the data from the given MultiByteBuffer to IOEngine -
Uses of ByteBuff in org.apache.hadoop.hbase.io.util
Modifier and TypeMethodDescriptionprivate static int
BlockIOUtils.copyToByteBuff
(byte[] buf, int offset, int len, ByteBuff out) static boolean
BlockIOUtils.preadWithExtra
(ByteBuff buff, org.apache.hadoop.fs.FSDataInputStream dis, long position, int necessaryLen, int extraLen) Read from an input stream at leastnecessaryLen
and if possible,extraLen
also if available.static boolean
BlockIOUtils.preadWithExtra
(ByteBuff buff, org.apache.hadoop.fs.FSDataInputStream dis, long position, int necessaryLen, int extraLen, boolean readAllBytes) Read from an input stream at leastnecessaryLen
and if possible,extraLen
also if available.private static boolean
BlockIOUtils.preadWithExtraDirectly
(ByteBuff buff, org.apache.hadoop.fs.FSDataInputStream dis, long position, int necessaryLen, int extraLen, boolean readAllBytes) private static boolean
BlockIOUtils.preadWithExtraOnHeap
(ByteBuff buff, org.apache.hadoop.fs.FSDataInputStream dis, long position, int necessaryLen, int extraLen, boolean readAllBytes) static void
Read length bytes into ByteBuffers directly.static void
BlockIOUtils.readFullyWithHeapBuffer
(InputStream in, ByteBuff out, int length) Copying bytes from InputStream toByteBuff
by using an temporary heap byte[] (default size is 1024 now).static int
StreamUtils.readRawVarint32
(ByteBuff input) static boolean
BlockIOUtils.readWithExtra
(ByteBuff buf, org.apache.hadoop.fs.FSDataInputStream dis, int necessaryLen, int extraLen) Read bytes into ByteBuffers directly, those buffers either contains the extraLen bytes or only contains necessaryLen bytes, which depends on how much bytes do the last time we read. -
Uses of ByteBuff in org.apache.hadoop.hbase.ipc
Modifier and TypeFieldDescriptionprivate ByteBuff
ServerRpcConnection.ByteBuffByteInput.buf
private ByteBuff
SimpleServerRpcConnection.data
Deprecated.Modifier and TypeMethodDescriptionprivate ByteBuff
CellBlockBuilder.decompress
(org.apache.hadoop.io.compress.CompressionCodec compressor, ByteBuff compressedCellBlock) Modifier and TypeMethodDescriptionprotected int
SimpleServerRpcConnection.channelDataRead
(ReadableByteChannel channel, ByteBuff buf) Deprecated.CellBlockBuilder.createCellScannerReusingBuffers
(Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, ByteBuff cellBlock) Create a cell scanner using an existing bytebuff.private org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream
private ByteBuff
CellBlockBuilder.decompress
(org.apache.hadoop.io.compress.CompressionCodec compressor, ByteBuff compressedCellBlock) private void
ServerRpcConnection.processConnectionHeader
(ByteBuff buf) void
ServerRpcConnection.processOneRpc
(ByteBuff buf) protected void
ServerRpcConnection.processRequest
(ByteBuff buf) Has the request header and the request param and optionally encoded data buffer all in this one array.private void
SimpleServerRpcConnection.saslReadAndProcess
(ByteBuff saslToken) Deprecated. -
Uses of ByteBuff in org.apache.hadoop.hbase.nio
Modifier and TypeClassDescriptionclass
Provides a unified view of all the underlying ByteBuffers and will look as if a bigger sequential buffer.class
An implementation of ByteBuff where a single BB backs the BBI.Modifier and TypeMethodDescriptionabstract ByteBuff
ByteBuff.duplicate()
Returns an ByteBuff which is a duplicate version of this ByteBuff.abstract ByteBuff
ByteBuff.limit
(int limit) Marks the limit of this ByteBuffabstract ByteBuff
ByteBuff.mark()
Marks the current position of the ByteBuffabstract ByteBuff
ByteBuff.moveBack
(int len) Jumps back the current position of this ByteBuff by specified length.abstract ByteBuff
ByteBuff.position
(int position) Sets this ByteBuff's position to the given value.abstract ByteBuff
ByteBuff.put
(byte b) Writes a byte to this ByteBuff at the current position and increments the positionabstract ByteBuff
ByteBuff.put
(byte[] src) Copies from the given byte[] to this ByteBuffabstract ByteBuff
ByteBuff.put
(byte[] src, int offset, int length) Copies from the given byte[] to this ByteBuffabstract ByteBuff
ByteBuff.put
(int index, byte b) Writes a byte to this ByteBuff at the given indexabstract ByteBuff
Copies the contents from the src ByteBuff to this ByteBuff.abstract ByteBuff
ByteBuff.putInt
(int value) Writes an int to this ByteBuff at its current position.abstract ByteBuff
ByteBuff.putLong
(long value) Writes a long to this ByteBuff at its current position.abstract ByteBuff
ByteBuff.reset()
Similar toByteBuffer
.reset(), ensures that this ByteBuff is reset back to last marked position.abstract ByteBuff
ByteBuff.rewind()
Rewinds this ByteBuff and the position is set to 0abstract ByteBuff
ByteBuff.skip
(int len) Jumps the current position of this ByteBuff by specified length.abstract ByteBuff
ByteBuff.slice()
Returns an ByteBuff which is a sliced version of this ByteBuff.ByteBuff.touch()
Calling this method in strategic locations where ByteBuffs are referenced may help diagnose potential buffer leaks.static ByteBuff
ByteBuff.wrap
(ByteBuffer buffer) static ByteBuff
ByteBuff.wrap
(ByteBuffer[] buffers) static ByteBuff
ByteBuff.wrap
(ByteBuffer[] buffers, ByteBuffAllocator.Recycler recycler) static ByteBuff
ByteBuff.wrap
(ByteBuffer[] buffers, RefCnt refCnt) In theory, the upstream should never construct an ByteBuff by passing an given refCnt, so please don't use this public method in other place.private static ByteBuff
ByteBuff.wrap
(ByteBuffer buffer, RefCnt refCnt) static ByteBuff
ByteBuff.wrap
(List<ByteBuffer> buffers) static ByteBuff
ByteBuff.wrap
(List<ByteBuffer> buffers, ByteBuffAllocator.Recycler recycler) private static ByteBuff
ByteBuff.wrap
(List<ByteBuffer> buffers, RefCnt refCnt) Modifier and TypeMethodDescriptionstatic int
Compares two ByteBuffsprivate static ByteBuffer
MultiByteBuff.getItemByteBuffer
(ByteBuff buf, int byteBufferIndex) private static int
MultiByteBuff.getItemByteBufferCount
(ByteBuff buf) private static int
MultiByteBuff.getItemIndexForByteBuff
(ByteBuff byteBuff, int offset, int length) private static int
MultiByteBuff.getRelativeOffsetForByteBuff
(ByteBuff byteBuff, int globalOffset, int itemIndex) abstract ByteBuff
Copies the contents from the src ByteBuff to this ByteBuff.Copies from a src BB to this MBB.static int
ByteBuff.readCompressedInt
(ByteBuff buf) Read integer from ByteBuff coded in 7 bits and increment position.static long
Read long which was written to fitInBytes bytes and increment position. -
Uses of ByteBuff in org.apache.hadoop.hbase.regionserver.wal
-
Uses of ByteBuff in org.apache.hadoop.hbase.util
Modifier and TypeFieldDescriptionprivate static final BiConsumer<ByteBuffer,
ByteBuff> ByteBufferArray.READER
Transfer bytes from sourceByteBuffer
to destinationByteBuff
, Position of both source and destination will be advanced.private static final BiConsumer<ByteBuffer,
ByteBuff> ByteBufferArray.WRITER
Transfer bytes from sourceByteBuff
to destinationByteBuffer
.Modifier and TypeMethodDescription(package private) static boolean
Check if bit at specified index is 1.boolean
Check if the specified key is contained in the bloom filter.boolean
Check if the specified key is contained in the bloom filter.static boolean
BloomFilterUtil.contains
(byte[] buf, int offset, int length, ByteBuff bloomBuf, int bloomOffset, int bloomSize, Hash hash, int hashCount) static boolean
BloomFilterUtil.contains
(Cell cell, ByteBuff bloomBuf, int bloomOffset, int bloomSize, Hash hash, int hashCount, BloomType type) private static <T> boolean
BloomFilterUtil.contains
(ByteBuff bloomBuf, int bloomOffset, int bloomSize, Hash hash, int hashCount, HashKey<T> hashKey) private int
ByteBufferArray.internalTransfer
(long offset, ByteBuff b, BiConsumer<ByteBuffer, ByteBuff> transfer) Transferring all remaining bytes from b to the buffers array starting at offset, or transferring bytes from the buffers array at offset to b until b is filled.int
Transfers bytes from this buffers array into the given destinationByteBuff
static long
Similar toWritableUtils.readVLong(java.io.DataInput)
but reads from aByteBuff
.int
Transfers bytes from the given sourceByteBuff
into this buffer arrayModifier and TypeMethodDescriptionprivate int
ByteBufferArray.internalTransfer
(long offset, ByteBuff b, BiConsumer<ByteBuffer, ByteBuff> transfer) Transferring all remaining bytes from b to the buffers array starting at offset, or transferring bytes from the buffers array at offset to b until b is filled.