Skip to content

Conversation

@gpg12
Copy link

@gpg12 gpg12 commented Oct 15, 2025

Description

This PR introduces RISC-V Vector (RVV) optimizations to Apache HBase to significantly improve performance on RISC-V platforms. The optimizations target three critical areas:

  1. LZ4 Compression/Decompression - Vectorized hash computation and dictionary operations
  2. BloomFilter Operations - Parallel bit manipulation and batch processing
  3. Scan Query Operations - Vectorized byte comparisons and prefix matching

Key Features

  • JNI integration with native C implementations using RVV intrinsics
  • Conditional compilation ensuring compatibility with non-RISC-V platforms
  • Runtime detection with graceful fallback mechanisms
  • Comprehensive test coverage and performance benchmarks
  • Backward compatibility maintained for existing deployments

Core Design Principles

  1. Conditional Compilation: Use #if defined(__riscv) && defined(__riscv_vector) to ensure RVV code only compiles on supported platforms
  2. Runtime Detection: Implement graceful fallback when RVV is unavailable
  3. Backward Compatibility: No impact on existing deployments or non-RISC-V platforms
  4. Performance Monitoring: Built-in metrics collection and performance analysis

JNI Integration Strategy

The implementation uses JNI to call native C functions that utilize RISC-V vector instructions for:

  • Vectorized memory operations (memcmp, memcpy)
  • Parallel hash computation for BloomFilter operations
  • Batch processing for improved throughput

Closes #HBASE-29658

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 33s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for branch
+1 💚 mvninstall 3m 37s master passed
+1 💚 compile 4m 28s master passed
+1 💚 checkstyle 1m 0s master passed
+1 💚 spotbugs 2m 27s master passed
+1 💚 spotless 0m 53s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
-1 ❌ mvninstall 0m 38s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 0m 15s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-1 ❌ compile 0m 39s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-1 ❌ compile 0m 13s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-1 ❌ cc 0m 15s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-1 ❌ cc 0m 39s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-1 ❌ cc 0m 13s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-1 ❌ golang 0m 15s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-1 ❌ golang 0m 39s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-1 ❌ golang 0m 13s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-0 ⚠️ javac 0m 15s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-0 ⚠️ javac 0m 39s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-0 ⚠️ javac 0m 13s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-0 ⚠️ blanks 0m 0s /blanks-eol.txt The patch has 48 line(s) that end in blanks. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
-0 ⚠️ checkstyle 0m 10s /buildtool-patch-checkstyle-hbase-common.txt The patch fails to run checkstyle in hbase-common
-0 ⚠️ checkstyle 0m 8s /buildtool-patch-checkstyle-hbase-server.txt The patch fails to run checkstyle in hbase-server
-0 ⚠️ checkstyle 0m 5s /buildtool-patch-checkstyle-hbase-compression_hbase-compression-lz4.txt The patch fails to run checkstyle in hbase-compression-lz4
-1 ❌ spotbugs 0m 12s /patch-spotbugs-hbase-common.txt hbase-common in the patch failed.
-1 ❌ spotbugs 0m 30s /patch-spotbugs-hbase-server.txt hbase-server in the patch failed.
-1 ❌ spotbugs 0m 12s /patch-spotbugs-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-1 ❌ hadoopcheck 0m 43s The patch causes 212 errors with Hadoop v3.3.6.
-1 ❌ hadoopcheck 1m 26s The patch causes 212 errors with Hadoop v3.4.1.
-1 ❌ spotless 0m 7s patch has 56 errors when running spotless:check, run spotless:apply to fix.
_ Other Tests _
-1 ❌ asflicense 0m 21s /results-asflicense.txt The patch generated 14 ASF License warnings.
20m 16s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7388
JIRA Issue HBASE-29658
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless cc golang
uname Linux 25242804c1c1 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 9396d72
Default Java Eclipse Adoptium-17.0.11+9
hadoopcheck https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-javac-3.3.6.txt
hadoopcheck https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-javac-3.4.1.txt
spotless https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-spotless.txt
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-compression/hbase-compression-lz4 U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 56s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for branch
+1 💚 mvninstall 5m 11s master passed
+1 💚 compile 2m 37s master passed
+1 💚 javadoc 1m 25s master passed
+1 💚 shadedjars 9m 5s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
-1 ❌ mvninstall 1m 9s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 0m 25s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-1 ❌ compile 0m 50s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-1 ❌ compile 0m 25s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-0 ⚠️ javac 0m 25s /patch-compile-hbase-common.txt hbase-common in the patch failed.
-0 ⚠️ javac 0m 50s /patch-compile-hbase-server.txt hbase-server in the patch failed.
-0 ⚠️ javac 0m 25s /patch-compile-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-0 ⚠️ javadoc 0m 25s /patch-javadoc-hbase-common.txt hbase-common in the patch failed.
-0 ⚠️ javadoc 0m 29s /patch-javadoc-hbase-server.txt hbase-server in the patch failed.
-0 ⚠️ javadoc 0m 23s /patch-javadoc-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
-1 ❌ shadedjars 1m 30s patch has 212 errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 0m 22s /patch-unit-hbase-common.txt hbase-common in the patch failed.
-1 ❌ unit 0m 44s /patch-unit-hbase-server.txt hbase-server in the patch failed.
-1 ❌ unit 0m 22s /patch-unit-hbase-compression_hbase-compression-lz4.txt hbase-compression-lz4 in the patch failed.
28m 42s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7388
JIRA Issue HBASE-29658
Optional Tests javac javadoc unit compile shadedjars
uname Linux 0a58c2361429 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 9396d72
Default Java Eclipse Adoptium-17.0.11+9
shadedjars https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-jdk17-hadoop3-check/output/patch-shadedjars.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/testReport/
Max. process+thread count 81 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-compression/hbase-compression-lz4 U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@gpg12 gpg12 closed this Oct 15, 2025
@gpg12 gpg12 reopened this Oct 21, 2025
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 15s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for branch
+1 💚 mvninstall 5m 38s master passed
+1 💚 compile 15m 28s master passed
+1 💚 checkstyle 2m 58s master passed
+1 💚 spotbugs 17m 17s master passed
+1 💚 spotless 1m 14s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
-1 ❌ mvninstall 1m 1s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 1m 6s /patch-compile-root.txt root in the patch failed.
-1 ❌ cc 1m 6s /patch-compile-root.txt root in the patch failed.
-1 ❌ golang 1m 6s /patch-compile-root.txt root in the patch failed.
-0 ⚠️ javac 1m 6s /patch-compile-root.txt root in the patch failed.
-0 ⚠️ blanks 0m 0s /blanks-eol.txt The patch has 56 line(s) that end in blanks. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
-0 ⚠️ checkstyle 0m 17s /buildtool-patch-checkstyle-root.txt The patch fails to run checkstyle in root
-1 ❌ spotbugs 0m 16s /patch-spotbugs-hbase-common.txt hbase-common in the patch failed.
-1 ❌ spotbugs 0m 56s /patch-spotbugs-hbase-server.txt hbase-server in the patch failed.
-1 ❌ spotbugs 3m 33s /patch-spotbugs-root.txt root in the patch failed.
-1 ❌ hadoopcheck 1m 10s The patch causes 16 errors with Hadoop v3.3.6.
-1 ❌ hadoopcheck 2m 16s The patch causes 16 errors with Hadoop v3.4.1.
-1 ❌ spotless 0m 10s patch has 63 errors when running spotless:check, run spotless:apply to fix.
_ Other Tests _
-1 ❌ asflicense 0m 45s /results-asflicense.txt The patch generated 14 ASF License warnings.
56m 44s
Subsystem Report/Notes
Docker ClientAPI=1.48 ServerAPI=1.48 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7388
JIRA Issue HBASE-29658
Optional Tests dupname asflicense codespell detsecrets spotless javac spotbugs checkstyle compile hadoopcheck hbaseanti cc golang
uname Linux 77e8e15e3d97 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e8500d4
Default Java Eclipse Adoptium-17.0.11+9
hadoopcheck https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-javac-3.3.6.txt
hadoopcheck https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-javac-3.4.1.txt
spotless https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-general-check/output/patch-spotless.txt
Max. process+thread count 163 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-compression/hbase-compression-lz4 . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 15s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 26s Maven dependency ordering for branch
+1 💚 mvninstall 5m 58s master passed
+1 💚 compile 4m 27s master passed
+1 💚 javadoc 5m 23s master passed
+1 💚 shadedjars 10m 6s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
-1 ❌ mvninstall 1m 5s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 0m 55s /patch-compile-root.txt root in the patch failed.
-0 ⚠️ javac 0m 55s /patch-compile-root.txt root in the patch failed.
-0 ⚠️ javadoc 0m 13s /patch-javadoc-hbase-common.txt hbase-common in the patch failed.
-0 ⚠️ javadoc 0m 40s /results-javadoc-javadoc-hbase-server.txt hbase-server generated 3 new + 63 unchanged - 0 fixed = 66 total (was 63)
-0 ⚠️ javadoc 0m 16s /patch-javadoc-root.txt root in the patch failed.
-1 ❌ shadedjars 0m 9s patch has 7 errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 0m 53s /patch-unit-root.txt root in the patch failed.
32m 54s
Subsystem Report/Notes
Docker ClientAPI=1.48 ServerAPI=1.48 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7388
JIRA Issue HBASE-29658
Optional Tests javac javadoc unit compile shadedjars
uname Linux 8497561e89d5 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e8500d4
Default Java Eclipse Adoptium-17.0.11+9
shadedjars https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/artifact/yetus-jdk17-hadoop3-check/output/patch-shadedjars.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/testReport/
Max. process+thread count 148 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-compression/hbase-compression-lz4 . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7388/1/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@gpg12 gpg12 marked this pull request as draft October 22, 2025 12:03
@gpg12 gpg12 marked this pull request as ready for review October 22, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants