ChenSammi commented on code in PR #5662:
URL: https://github.com/apache/ozone/pull/5662#discussion_r1452897214
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java:
##########
@@ -224,4 +235,168 @@ public void compactionIfNeeded() throws Exception {
}
}
}
+
+ @Override
+ public BlockData getBlockByID(BlockID blockID,
+ KeyValueContainerData containerData) throws IOException {
+ String blockKey = containerData.getBlockKey(blockID.getLocalID());
+
+ // check last chunk table
+ BlockData lastChunk = getLastChunkInfoTable().get(blockKey);
+ // check block data table
+ BlockData blockData = getBlockDataTable().get(blockKey);
+
+ if (blockData == null) {
+ if (lastChunk == null) {
+ throw new StorageContainerException(
+ NO_SUCH_BLOCK_ERR_MSG + " BlockID : " + blockID, NO_SUCH_BLOCK);
+ } else {
+ LOG.debug("blockData=(null), lastChunk={}", lastChunk.getChunks());
+ return lastChunk;
+ }
+ } else {
+ if (lastChunk != null) {
+ reconcilePartialChunks(lastChunk, blockData);
+ } else {
+ LOG.debug("blockData={}, lastChunk=(null)", blockData.getChunks());
Review Comment:
Could you add the LOG.isDebugEnabled check here, L254 and L270?
--
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]