@InterfaceAudience.Private public class ExclusiveMemHFileBlock extends HFileBlock
ByteBuffAllocator
won't allocate pooled heap ByteBuff
now; at the same time,
if allocate an off-heap ByteBuff
from allocator, then it must be a pooled one. That's to
say, an exclusive memory HFileBlock would must be an heap block and a shared memory HFileBlock
would must be an off-heap block.
The exclusive memory HFileBlock will do nothing when calling retain or release methods, because its memory will be garbage collected by JVM, even if its reference count decrease to zero, we can do nothing for the de-allocating.
SharedMemHFileBlock
HFileBlock.BlockDeserializer, HFileBlock.BlockIterator, HFileBlock.BlockWritable, HFileBlock.FSReader, HFileBlock.FSReaderImpl, HFileBlock.Header, HFileBlock.Writer
BLOCK_DESERIALIZER, BLOCK_METADATA_SPACE, CHECKSUM_SIZE, CHECKSUM_VERIFICATION_NUM_IO_THRESHOLD, DONT_FILL_HEADER, DUMMY_HEADER_NO_CHECKSUM, FILL_HEADER, FIXED_OVERHEAD, MULTI_BYTE_BUFFER_HEAP_SIZE
Constructor and Description |
---|
ExclusiveMemHFileBlock(BlockType blockType,
int onDiskSizeWithoutHeader,
int uncompressedSizeWithoutHeader,
long prevBlockOffset,
ByteBuff buf,
boolean fillHeader,
long offset,
int nextBlockOnDiskSize,
int onDiskDataSizeWithHeader,
HFileContext fileContext,
ByteBuffAllocator alloc) |
Modifier and Type | Method and Description |
---|---|
boolean |
isSharedMem()
Will be override by
SharedMemHFileBlock or ExclusiveMemHFileBlock . |
int |
refCnt()
Reference count of this Cacheable.
|
boolean |
release()
Call
ByteBuff.release() to decrease the reference count, if no other reference, it will
return back the ByteBuffer to ByteBuffAllocator |
ExclusiveMemHFileBlock |
retain()
Increase its reference count, and only when no reference we can free the object's memory.
|
createFromBuff, deepCloneOnHeap, equals, getBlockType, getBufferReadOnly, getBufferWithoutHeader, getBufferWithoutHeader, getByteBuffAllocator, getBytesPerChecksum, getByteStream, getChecksumType, getDataBlockEncoding, getDataBlockEncodingId, getDeserializer, getDummyHeaderForVersion, getHFileContext, getMetaData, getNextBlockOnDiskSize, getOffset, getOnDiskDataSizeWithHeader, getOnDiskSizeWithHeader, getOnDiskSizeWithoutHeader, getPrevBlockOffset, getSerializedLength, getUncompressedSizeWithoutHeader, hashCode, headerSize, headerSize, heapSize, isUnpacked, sanityCheck, sanityCheckUncompressed, serialize, shallowClone, toString, toStringHeader, totalChecksumBytes, unpack
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
release, retain, touch, touch
ExclusiveMemHFileBlock(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator alloc)
public int refCnt()
Cacheable
refCnt
in interface Cacheable
refCnt
in interface org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
refCnt
in class HFileBlock
public ExclusiveMemHFileBlock retain()
Cacheable
retain
in interface Cacheable
retain
in interface org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
retain
in class HFileBlock
public boolean release()
HFileBlock
ByteBuff.release()
to decrease the reference count, if no other reference, it will
return back the ByteBuffer
to ByteBuffAllocator
release
in interface Cacheable
release
in interface org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
release
in class HFileBlock
public boolean isSharedMem()
HFileBlock
SharedMemHFileBlock
or ExclusiveMemHFileBlock
. Return true
by default.isSharedMem
in class HFileBlock
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.