jinhyukify commented on code in PR #7782:
URL: https://github.com/apache/hbase/pull/7782#discussion_r2835954359
##########
hbase-shaded/pom.xml:
##########
@@ -537,6 +537,16 @@
<exclude>keytab.txt</exclude>
</excludes>
</filter>
+ <filter>
+ <!-- We are not ready to use JDK 25 yet, and these classes
cause shading
+ errors on older ASM versions.
+ Safe to remove if upgrading the shade plugin to 3.6.1
or later.
+ -->
+ <artifact>com.dynatrace.hash4j:hash4j</artifact>
+ <excludes>
+ <exclude>META-INF/versions/25/**</exclude>
+ </excludes>
+ </filter>
Review Comment:
Another possible fix is upgrading the `maven-shade-plugin` from 3.6.0 to
3.6.1, since ASM starts supporting Java 25 in 3.6.1.
However, we’re not ready to adopt this jdk version.
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/XXH3.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.util;
+
+import com.dynatrace.hash4j.hashing.Hasher64;
+import com.dynatrace.hash4j.hashing.Hashing;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
+
+/**
+ * XXH3 64-bit hash implementation based on hash4j library.
+ * <p>
+ * Provides high throughput, strong dispersion, and minimal memory usage,
optimized for modern CPU
+ * architectures.
+ * @see <a href=
+ *
"https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md#xxh3-algorithm-overview">XXH3
+ * Algorithm</a>
+ */
[email protected]
[email protected]
+public class XXH3 extends Hash implements Hash64 {
+ private static final XXH3 _instance = new XXH3();
+
+ public static Hash getInstance() {
+ return _instance;
+ }
+
+ @Override
+ public <T> long hash64(HashKey<T> hashKey, long seed) {
+ Hasher64 hasher = seed == 0L ? Hashing.xxh3_64() : Hashing.xxh3_64(seed);
+ return hasher.hashBytesToLong(hashKey, 0, hashKey.length(),
HashKeyByteAccess.INSTANCE);
Review Comment:
I think tests for the hash function itself are outside the scope of this
change.
The actual verification was done separately, and all hash functions behave
as expected.
The test did on
https://github.com/jinhyukify/hbase/commit/ed1c82119d9151cf73bd3dab67a3060fb06cce82
##########
pom.xml:
##########
@@ -983,6 +983,8 @@
<lz4.version>1.10.1</lz4.version>
<snappy.version>1.1.10.4</snappy.version>
<zstd-jni.version>1.5.7-2</zstd-jni.version>
+ <!-- hash -->
+ <hash4j.version>0.29.0</hash4j.version>
Review Comment:
Not fully sure if I should add this dependency here
##########
hbase-shaded/pom.xml:
##########
@@ -537,6 +537,16 @@
<exclude>keytab.txt</exclude>
</excludes>
</filter>
+ <filter>
+ <!-- We are not ready to use JDK 25 yet, and these classes
cause shading
+ errors on older ASM versions.
+ Safe to remove if upgrading the shade plugin to 3.6.1
or later.
+ -->
+ <artifact>com.dynatrace.hash4j:hash4j</artifact>
+ <excludes>
+ <exclude>META-INF/versions/25/**</exclude>
+ </excludes>
+ </filter>
Review Comment:
fyi: we get the following errors without this
```
.m2/repository/com/dynatrace/hash4j/hash4j/0.29.0/hash4j-0.29.0.jar entry
META-INF/versions/25/com/dynatrace/hash4j/hashing/FFMUtil$MemorySegmentByteAccess.class:
java.lang.IllegalArgumentException: Unsupported class file major version 69
```
--
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]