openinx commented on a change in pull request #268: HBASE-22491 Separate the
heap HFileBlock and offheap HFileBlock because the heap block won't need refCnt
and save into prevBlocks list before shipping
URL: https://github.com/apache/hbase/pull/268#discussion_r292771646
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
##########
@@ -393,29 +378,19 @@ public HFileBlock(BlockType blockType, int
onDiskSizeWithoutHeader,
}
fileContext = fileContextBuilder.build();
assert usesHBaseChecksum == fileContext.isUseHBaseChecksum();
- init(blockType, onDiskSizeWithoutHeader, uncompressedSizeWithoutHeader,
prevBlockOffset, offset,
- onDiskDataSizeWithHeader, nextBlockOnDiskSize, fileContext, allocator);
- this.offset = offset;
- this.buf = buf;
- this.buf.rewind();
- }
-
- /**
- * Called from constructors.
- */
- private void init(BlockType blockType, int onDiskSizeWithoutHeader,
- int uncompressedSizeWithoutHeader, long prevBlockOffset, long offset,
- int onDiskDataSizeWithHeader, final int nextBlockOnDiskSize,
HFileContext fileContext,
- ByteBuffAllocator allocator) {
- this.blockType = blockType;
- this.onDiskSizeWithoutHeader = onDiskSizeWithoutHeader;
- this.uncompressedSizeWithoutHeader = uncompressedSizeWithoutHeader;
- this.prevBlockOffset = prevBlockOffset;
- this.offset = offset;
- this.onDiskDataSizeWithHeader = onDiskDataSizeWithHeader;
- this.nextBlockOnDiskSize = nextBlockOnDiskSize;
- this.fileContext = fileContext;
- this.allocator = allocator;
+ return new HFileBlockBuilder()
+ .withBlockType(blockType)
+ .withOnDiskSizeWithoutHeader(onDiskSizeWithoutHeader)
+ .withUncompressedSizeWithoutHeader(uncompressedSizeWithoutHeader)
+ .withPrevBlockOffset(prevBlockOffset)
+ .withOffset(offset)
+ .withOnDiskDataSizeWithHeader(onDiskDataSizeWithHeader)
+ .withNextBlockOnDiskSize(nextBlockOnDiskSize)
+ .withHFileContext(fileContext)
+ .withByteBuffAllocator(allocator)
+ .withOffset(offset)
Review comment:
Yeah, Let me fix this. Thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services