szetszwo commented on code in PR #9733:
URL: https://github.com/apache/ozone/pull/9733#discussion_r2780452622


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisRequest.java:
##########
@@ -111,9 +112,10 @@ public Message encode() throws 
InvalidProtocolBufferException {
     }
     methodBuilder.addAllArgs(args);
     requestProtoBuilder.setMethod(methodBuilder.build());
+    final SCMRatisRequestProto requestProto = requestProtoBuilder.build();
     return Message.valueOf(
-        org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFrom(
-            requestProtoBuilder.build().toByteArray()));
+        UnsafeByteOperations.unsafeWrap(
+            requestProto.toByteString().asReadOnlyByteBuffer()));

Review Comment:
   @Russole , I see how this change works now -- it does prevent copying to an 
array but still needs type conversion from com.google.protobuf.ByteString to 
org.apache.ratis.thirdparty.com.google.protobuf.ByteString.
   
   Let's fix also the conversion in this JIRA; see ContainerCommandRequestProto 
as an example for how to do it.



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