You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Anoop Sam John (JIRA)" <ji...@apache.org> on 2016/05/06 11:28:12 UTC
[jira] [Created] (HBASE-15785) Unnecessary lock in
ByteBufferArray#asSubByteBuff
Anoop Sam John created HBASE-15785:
--------------------------------------
Summary: Unnecessary lock in ByteBufferArray#asSubByteBuff
Key: HBASE-15785
URL: https://issues.apache.org/jira/browse/HBASE-15785
Project: HBase
Issue Type: Sub-task
Affects Versions: 2.0.0
Reporter: Anoop Sam John
Assignee: Anoop Sam John
Fix For: 2.0.0
{code}
Lock lock = locks[i];
lock.lock();
try {
ByteBuffer bb = buffers[i];
if (i == startBuffer) {
cnt = bufferSize - startBufferOffset;
if (cnt > len) cnt = len;
ByteBuffer dup = bb.duplicate();
dup.limit(startBufferOffset + cnt).position(startBufferOffset);
mbb[j] = dup.slice();
{code}
In asSubByteBuff, we work on the duplicate BB and set limit and position on that.. The locking is not needed here.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)