martin-g commented on a change in pull request #1186: HBASE-19146 Update 
Protobuf to 3.11.4
URL: https://github.com/apache/hbase/pull/1186#discussion_r385366797
 
 

 ##########
 File path: 
hbase-protocol/src/main/java/org/apache/hadoop/hbase/util/ByteStringer.java
 ##########
 @@ -56,14 +55,16 @@ private ByteStringer() {
    * Wraps a byte array in a {@link ByteString} without copying it.
    */
   public static ByteString wrap(final byte[] array) {
-    return USE_ZEROCOPYBYTESTRING? HBaseZeroCopyByteString.wrap(array): 
ByteString.copyFrom(array);
+    return USE_ZEROCOPYBYTESTRING
+      ? UnsafeByteOperations.unsafeWrap(array)
+      : ByteString.copyFrom(array);
   }
 
   /**
    * Wraps a subset of a byte array in a {@link ByteString} without copying it.
    */
   public static ByteString wrap(final byte[] array, int offset, int length) {
-    return USE_ZEROCOPYBYTESTRING? HBaseZeroCopyByteString.wrap(array, offset, 
length):
+    return USE_ZEROCOPYBYTESTRING? UnsafeByteOperations.unsafeWrap(array, 
offset, length):
       ByteString.copyFrom(array, offset, length);
   }
 }
 
 Review comment:
   HBase 3.0.0. I think it might break someone's setup if it is done in 2.x.
   
   But I agree that PB must be shaded and HBase itself should use only the 
shaded version. This will make it easier to upgrade in the future and third 
parties won't be affected.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to