You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Russole (via GitHub)" <gi...@apache.org> on 2026/02/18 05:30:24 UTC

[PR] HDDS-14623. Remove ProtoUtils [ozone]

Russole opened a new pull request, #9783:
URL: https://github.com/apache/ozone/pull/9783

   ## What changes were proposed in this pull request?
   
   * Replace usages of `ProtoUtils.unsafeByteString` with `UnsafeByteOperations.unsafeWrap`.
   * Remove `ProtoUtils` class.
   * Update related imports and adjust null/empty checks to preserve existing behavior.
   * Ensure all affected tests and call sites are updated accordingly.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-14623
   ## How was this patch tested?
   - All CI checks passed.
   
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #9783:
URL: https://github.com/apache/ozone/pull/9783#issuecomment-3922743053

   @Russole , thanks for working on this!
   
   @Gargi-jais11 , @adoroszlai , thanks for reviewing this!


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #9783:
URL: https://github.com/apache/ozone/pull/9783#discussion_r2820659701


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/PayloadUtils.java:
##########
@@ -52,7 +51,9 @@ public static byte[] generatePayload(int payloadSizeBytes) {
   }
 
   public static com.google.protobuf.ByteString generatePayloadProto2(int payloadSizeBytes) {
-    return ProtoUtils.unsafeByteString(generatePayload(payloadSizeBytes));
+    byte[] payload = generatePayload(payloadSizeBytes);
+    return payload.length > 0 ? com.google.protobuf.UnsafeByteOperations.unsafeWrap(payload)
+        : com.google.protobuf.ByteString.EMPTY;

Review Comment:
   @Gargi-jais11 cannot import the same name from two different packages:
   
   https://github.com/apache/ozone/blob/12bc8b6ce5372537a450e8016288a5437bb46fc9/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/PayloadUtils.java#L21-L22



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "Gargi-jais11 (via GitHub)" <gi...@apache.org>.
Gargi-jais11 commented on code in PR #9783:
URL: https://github.com/apache/ozone/pull/9783#discussion_r2820607717


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/PayloadUtils.java:
##########
@@ -52,7 +51,9 @@ public static byte[] generatePayload(int payloadSizeBytes) {
   }
 
   public static com.google.protobuf.ByteString generatePayloadProto2(int payloadSizeBytes) {
-    return ProtoUtils.unsafeByteString(generatePayload(payloadSizeBytes));
+    byte[] payload = generatePayload(payloadSizeBytes);
+    return payload.length > 0 ? com.google.protobuf.UnsafeByteOperations.unsafeWrap(payload)
+        : com.google.protobuf.ByteString.EMPTY;

Review Comment:
   Nit: Please add imports for `UnsafeByteOperations` and `ByteString`



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on PR #9783:
URL: https://github.com/apache/ozone/pull/9783#issuecomment-3923936603

   Thanks @szetszwo for the review and merge! Much appreciated.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo merged PR #9783:
URL: https://github.com/apache/ozone/pull/9783


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "Gargi-jais11 (via GitHub)" <gi...@apache.org>.
Gargi-jais11 commented on code in PR #9783:
URL: https://github.com/apache/ozone/pull/9783#discussion_r2820684400


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/PayloadUtils.java:
##########
@@ -52,7 +51,9 @@ public static byte[] generatePayload(int payloadSizeBytes) {
   }
 
   public static com.google.protobuf.ByteString generatePayloadProto2(int payloadSizeBytes) {
-    return ProtoUtils.unsafeByteString(generatePayload(payloadSizeBytes));
+    byte[] payload = generatePayload(payloadSizeBytes);
+    return payload.length > 0 ? com.google.protobuf.UnsafeByteOperations.unsafeWrap(payload)
+        : com.google.protobuf.ByteString.EMPTY;

Review Comment:
   Okay Thanks @adoroszlai for pointing out this. Missed that there are others with same name.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-14623. Remove ProtoUtils [ozone]

Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on PR #9783:
URL: https://github.com/apache/ozone/pull/9783#issuecomment-3920256472

   Thanks @adoroszlai , @Gargi-jais11 for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org