You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2020/06/04 10:47:00 UTC

[jira] [Commented] (HBASE-15785) Unnecessary lock in ByteBufferArray

    [ https://issues.apache.org/jira/browse/HBASE-15785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17125811#comment-17125811 ] 

Hudson commented on HBASE-15785:
--------------------------------

Results for branch branch-1
	[build #1308 on builds.a.o|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/1308/]: (x) *{color:red}-1 overall{color}*
----
details (if available):

(/) {color:green}+1 general checks{color}
-- For more information [see general report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/1308//General_Nightly_Build_Report/]


(x) {color:red}-1 jdk7 checks{color}
-- For more information [see jdk7 report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/1308//JDK7_Nightly_Build_Report/]


(x) {color:red}-1 jdk8 hadoop2 checks{color}
-- For more information [see jdk8 (hadoop2) report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/1308//JDK8_Nightly_Build_Report_(Hadoop2)/]




(x) {color:red}-1 source release artifact{color}
-- See build output for details.


> 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
>            Priority: Major
>             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
(v8.3.4#803005)