jojochuang commented on code in PR #9535:
URL: https://github.com/apache/ozone/pull/9535#discussion_r2687612309
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -2092,7 +2092,13 @@ public ContainerCommandResponseProto readBlock(
}
try {
readBlockImpl(request, blockFile, kvContainer, streamObserver, false);
- // TODO metrics.incContainerBytesStats(Type.ReadBlock,
readBlock.getLen());
+ final ReadBlockRequestProto readBlock = request.getReadBlock();
+ final BlockID blockID = BlockID.getFromProtobuf(readBlock.getBlockID());
+ final BlockData blockData = getBlockManager().getBlock(kvContainer,
blockID);
Review Comment:
this is an expensive operation because it involves reading from rocksdb. And
for the most part this blockData is not going to be used since readBlock
usually has length. So this is a waste.
IMO, we should let readBlockImpl() to return the length it actually read and
use that as the counter for bytesRead.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]