richardstartin commented on code in PR #8766:
URL: https://github.com/apache/pinot/pull/8766#discussion_r880814967
##########
pinot-core/src/main/java/org/apache/pinot/core/query/pruner/ColumnValueSegmentPruner.java:
##########
@@ -435,4 +446,17 @@ private static Comparable convertValue(String stringValue,
DataType dataType) {
throw new BadQueryRequestException(e);
}
}
+
+ private static class Hash128 {
+ private final long _hash1;
+ private final long _hash2;
+
+ private Hash128(Object value) {
+ String strValue = value.toString();
+
+ byte[] hash = GuavaBloomFilterReaderUtils.hash(strValue);
+ _hash1 = Longs.fromBytes(hash[7], hash[6], hash[5], hash[4], hash[3],
hash[2], hash[1], hash[0]);
+ _hash2 = Longs.fromBytes(hash[15], hash[14], hash[13], hash[12],
hash[11], hash[10], hash[9], hash[8]);
Review Comment:
let's improve this code on JDK11+ with
`MethodHandles.byteArrayViewVarHandle()` (which will itself need to be dealt
with via `MethodHandle` :() so we can read two longs directly from the array.
This can use `Unsafe` on JDK8, or just do it the slow way like 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: [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]