You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Wellington Chevreuil (JIRA)" <ji...@apache.org> on 2019/05/29 16:26:00 UTC
[jira] [Created] (HBASE-22496) UnsafeAccess.unsafeCopy should not
copy more than UNSAFE_COPY_THRESHOLD on each iteration
Wellington Chevreuil created HBASE-22496:
--------------------------------------------
Summary: UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration
Key: HBASE-22496
URL: https://issues.apache.org/jira/browse/HBASE-22496
Project: HBase
Issue Type: Improvement
Reporter: Wellington Chevreuil
Assignee: Wellington Chevreuil
In *UnsafeAccess.unsafeCopy*, we calculate a _size_ __ to be read, no greater than UNSAFE_COPY_THRESHOLD, if total _len_ is larger than UNSAFE_COPY_THRESHOLD:
{noformat}
long size = (len > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : len;
{noformat}
But then we simply read the whole len anyway:
{noformat}
theUnsafe.copyMemory(src, srcAddr, dst, destAddr, len);
{noformat}
I believe the real intention here is to copy chunks of _size_ bytes, the current code is already copying everything on the first iteration, then performing additional chunked copies.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)