chungen0126 commented on code in PR #6613:
URL: https://github.com/apache/ozone/pull/6613#discussion_r1867485456


##########
hadoop-hdds/interface-client/src/main/proto/DatanodeClientProtocol.proto:
##########
@@ -108,6 +108,7 @@ enum Type {
 
   FinalizeBlock = 21;
   Echo = 22;
+  ReadBlock = 23;

Review Comment:
   done



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java:
##########
@@ -874,4 +876,57 @@ public static List<Validator> toValidatorList(Validator 
validator) {
     return datanodeToResponseMap;
   }
 
+  /**
+   * Calls the container protocol to read a chunk.
+   *
+   * @param xceiverClient  client to perform call
+   * @param blockID        ID of the block
+   * @param validators     functions to validate the response
+   * @param token          a token for this block (may be null)
+   * @return container protocol read chunk response
+   * @throws IOException if there is an I/O error while performing the call
+   */
+  @SuppressWarnings("checkstyle:ParameterNumber")
+  public static ContainerProtos.ReadBlockResponseProto readBlock(
+      XceiverClientSpi xceiverClient, long offset, long len, BlockID blockID,
+      List<Validator> validators, Token<? extends TokenIdentifier> token,
+      Map<DatanodeDetails, Integer> replicaIndexes, boolean verifyChecksum) 
throws IOException {
+    final ReadBlockRequestProto.Builder readBlockRequest =
+        ReadBlockRequestProto.newBuilder()
+            .setOffset(offset)
+            .setVerifyChecksum(verifyChecksum)
+            .setLen(len);
+    final ContainerCommandRequestProto.Builder builder =
+        ContainerCommandRequestProto.newBuilder().setCmdType(Type.ReadBlock)
+            .setContainerID(blockID.getContainerID());
+    if (token != null) {
+      builder.setEncodedToken(token.encodeToUrlString());
+    }
+
+

Review Comment:
   removed



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