[
https://issues.apache.org/jira/browse/HBASE-29688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18033545#comment-18033545
]
Charles Connell commented on HBASE-29688:
-----------------------------------------
Per [request|https://github.com/apache/hbase/pull/7418#issuecomment-3454069450]
from Duo, I'll wait until after 3.0 is released to make this change
> Use VarHandle instead of Unsafe where possible in 3.x
> -----------------------------------------------------
>
> 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)