errose28 commented on code in PR #6945:
URL: https://github.com/apache/ozone/pull/6945#discussion_r1687006365
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -157,6 +159,28 @@ private void write(KeyValueContainerData data,
ContainerProtos.ContainerChecksum
}
}
+ public byte[] readChecksumFileAsBytes(KeyValueContainerData data) {
+ long containerID = data.getContainerID();
+ Lock readLock = getReadLock(containerID);
+ readLock.lock();
+ try {
+ File checksumFile = getContainerChecksumFile(data);
+
+ try (FileInputStream inStream = new FileInputStream(checksumFile)) {
+ return IOUtils.toByteArray(inStream);
Review Comment:
Can we use proto `ByteString` directly to reduce the number of copies
required from 2 to 1? I think the only usage of this method requires a
`ByteString` as output.
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java:
##########
@@ -723,6 +723,34 @@ public static EchoResponseProto echo(XceiverClientSpi
client, String encodedCont
return response.getEcho();
}
+ public static ContainerProtos.ReadContainerMerkleTreeResponseProto
readContainerMerkleTree(
Review Comment:
Since this is an API let's put javadoc on it.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/TokenHelper.java:
##########
@@ -40,16 +40,16 @@
/**
* Wraps block and container token managers for datanode.
*/
-class TokenHelper {
+public class TokenHelper {
Review Comment:
Rather than change the access modifiers we should probably change the
package if we are using this for more than just reconstruction now.
--
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]