You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Charles Connell (Jira)" <ji...@apache.org> on 2026/10/15 22:52:00 UTC
[jira] [Updated] (HBASE-29688) Use VarHandle instead of Unsafe where possible to access memory
[ https://issues.apache.org/jira/browse/HBASE-29688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charles Connell updated HBASE-29688:
------------------------------------
Summary: Use VarHandle instead of Unsafe where possible to access memory (was: Use VarHandle instead of Unsafe where possible)
> Use VarHandle instead of Unsafe where possible to access memory
> ---------------------------------------------------------------
>
> Key: HBASE-29688
> URL: https://issues.apache.org/jira/browse/HBASE-29688
> Project: HBase
> Issue Type: Improvement
> Reporter: Charles Connell
> Assignee: Charles Connell
> Priority: Minor
> Labels: pull-request-available
>
> Java offers {{VarHandle}} to facilitate fast access to memory, in place of the {{Unsafe#get*}} and {{Unsafe#put*}} methods. It can be used as almost a drop-in replacement, and the performance is similar. {{VarHandle}} was introduced in Java 9. HBase 2.x supports Java 8, so we cannot use {{VarHandle}} in 2.x releases, but we can prepare to use it in 3.x releases, which target Java 17. This will eliminate most uses of {{Unsafe}} in HBase. Remaining uses of {{Unsafe}} are for copying memory regions. There is an alternative available for that, {{MemorySegment}}, that is available in Java 22 and higher, but we'll tackle that much later.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)