errose28 commented on code in PR #6945:
URL: https://github.com/apache/ozone/pull/6945#discussion_r1697583331
##########
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:
Right, building the tree would be handled in the layer above based on the
result of this method. We can update the comment. I'm actually thinking we
should debug log here because this will get printed for every container the
scanner encounters in the first run.
--
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]