mbaedke commented on code in PR #2461:
URL: https://github.com/apache/jackrabbit-oak/pull/2461#discussion_r2290632447


##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/codec/ResponseDecoder.java:
##########
@@ -203,11 +205,21 @@ private static void decodeGetReferencesResponse(int 
length, ByteBuf in, List<Obj
     }
 
     private static long hash(byte[] data) {
-        return 
Hashing.murmur3_32().newHasher().putBytes(data).hash().padToLong();
+        return Integer.toUnsignedLong(MurmurHash3.hash32x86(data));
     }
 
     private static long hash(byte mask, long blobLength, byte[] data) {
-        return 
Hashing.murmur3_32().newHasher().putByte(mask).putLong(blobLength).putBytes(data).hash().padToLong();
+
+        final ByteBuffer byteBuffer = ByteBuffer.allocate(1 + 8 + data.length)
+                .order(ByteOrder.LITTLE_ENDIAN)  // To align with Guava that 
uses Little Endianess
+                .put(mask)
+                .putLong(blobLength)
+                .put(data);
+        byteBuffer.flip();  // Reset position to start to read data from 
beginning
+        final byte[] bytes = new byte[byteBuffer.limit()];
+        byteBuffer.get(bytes);

Review Comment:
   Can't we just use ByteBuffer#array() here?



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to