[ https://issues.apache.org/jira/browse/HBASE-15785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280343#comment-15280343 ]
Hudson commented on HBASE-15785: -------------------------------- FAILURE: Integrated in HBase-Trunk_matrix #913 (See [https://builds.apache.org/job/HBase-Trunk_matrix/913/]) HBASE-15785 Unnecessary lock in ByteBufferArray. (anoopsamjohn: rev c9ebcd4e296a31e0da43f513db3f5a8c3929c191) * hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java * hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java > Unnecessary lock in ByteBufferArray > ----------------------------------- > > Key: HBASE-15785 > URL: https://issues.apache.org/jira/browse/HBASE-15785 > Project: HBase > Issue Type: Sub-task > Components: regionserver, Scanners > Affects Versions: 2.0.0 > Reporter: Anoop Sam John > Assignee: Anoop Sam John > Fix For: 2.0.0 > > Attachments: HBASE-15785.patch, HBASE-15785_V2.patch, > HBASE-15785_V3.patch > > > {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. > The locking is added because we set limit and position on the BBs in the > array. We can duplicate the BBs and do positioning and limit on them. The > locking can be fully avoided. -- This message was sent by Atlassian JIRA (v6.3.4#6332)