ss77892 commented on code in PR #11873:
URL: https://github.com/apache/ozone/pull/11873#discussion_r4587844181


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/io/RandomAccessFileChannel.java:
##########
@@ -56,6 +64,35 @@ public synchronized void open(File file) throws 
FileNotFoundException {
     channel = newChannel;
   }
 
+  /**
+   * @return the {@link BlockData} cached for the given block, or null if none 
is cached for it or the cached one has
+   * a lower BCSID than requested.
+   */
+  public BlockData getCachedBlockData(BlockID blockID) {
+    final BlockData cached = cachedBlockData.get();
+    return cached != null && 
cached.getBlockID().getContainerBlockID().equals(blockID.getContainerBlockID())
+        && cached.getBlockCommitSequenceId() >= 
blockID.getBlockCommitSequenceId() ? cached : null;
+  }

Review Comment:
   Done



-- 
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]

Reply via email to