kerneltime commented on code in PR #6945:
URL: https://github.com/apache/ozone/pull/6945#discussion_r1697560960


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -166,6 +168,31 @@ private void write(KeyValueContainerData data, 
ContainerProtos.ContainerChecksum
     }
   }
 
+  public ByteString getContainerChecksumInfo(KeyValueContainerData data)
+      throws IOException {
+    long containerID = data.getContainerID();
+    Lock readLock = getReadLock(containerID);
+    readLock.lock();
+    try {
+      File checksumFile = getContainerChecksumFile(data);
+
+      try (FileInputStream inStream = new FileInputStream(checksumFile)) {
+        return ByteString.readFrom(inStream);
+      } catch (FileNotFoundException ex) {
+        // TODO: Build the container checksum tree when it doesn't exist.

Review Comment:
   We should not build it here, also this can be a WARN as post upgrade all 
containers won't have a checksum tree file



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