kerneltime commented on code in PR #6945:
URL: https://github.com/apache/ozone/pull/6945#discussion_r1697561296
##########
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.
+ LOG.error("No checksum file currently exists for container {} at the
path {}. Returning an empty instance.",
+ containerID, checksumFile, ex);
+ } catch (IOException ex) {
+ throw new IOException("Error occured when reading checksum file for
container " + containerID +
+ " at the path " + checksumFile, ex);
+
Review Comment:
redundant new line
--
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]