Package org.apache.hadoop.hbase.io.hfile
Class ExclusiveMemHFileBlock
java.lang.Object
org.apache.hadoop.hbase.io.hfile.HFileBlock
org.apache.hadoop.hbase.io.hfile.ExclusiveMemHFileBlock
- All Implemented Interfaces:
HeapSize
,Cacheable
,HBaseReferenceCounted
,org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
The
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlock
HFileBlock.BlockDeserializer, HFileBlock.BlockIterator, HFileBlock.BlockWritable, HFileBlock.FSReader, HFileBlock.FSReaderImpl, HFileBlock.Header, HFileBlock.Writer
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlock
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 Summary
ConstructorDescriptionExclusiveMemHFileBlock
(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator alloc) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Will be override bySharedMemHFileBlock
orExclusiveMemHFileBlock
.int
refCnt()
Reference count of this Cacheable.boolean
release()
CallByteBuff.release()
to decrease the reference count, if no other reference, it will return back theByteBuffer
toByteBuffAllocator
retain()
Increase its reference count, and only when no reference we can free the object's memory.Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlock
createFromBuff, deepCloneOnHeap, equals, getBlockType, getBufferReadOnly, 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, toString, toStringHeader, totalChecksumBytes, touch, touch, unpack
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.nio.HBaseReferenceCounted
release, retain
-
Constructor Details
-
ExclusiveMemHFileBlock
ExclusiveMemHFileBlock(BlockType blockType, int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuff buf, boolean fillHeader, long offset, int nextBlockOnDiskSize, int onDiskDataSizeWithHeader, HFileContext fileContext, ByteBuffAllocator alloc)
-
-
Method Details
-
refCnt
Description copied from interface:Cacheable
Reference count of this Cacheable.- Specified by:
refCnt
in interfaceCacheable
- Specified by:
refCnt
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
refCnt
in classHFileBlock
-
retain
Description copied from interface:Cacheable
Increase its reference count, and only when no reference we can free the object's memory.- Specified by:
retain
in interfaceCacheable
- Specified by:
retain
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
retain
in classHFileBlock
-
release
Description copied from class:HFileBlock
CallByteBuff.release()
to decrease the reference count, if no other reference, it will return back theByteBuffer
toByteBuffAllocator
- Specified by:
release
in interfaceCacheable
- Specified by:
release
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
release
in classHFileBlock
-