Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6711

Avoid local results copy in StoreScanner

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.94.2
    • Component/s: None
    • Labels:
      None

      Description

      In StoreScanner the number of results is limited to avoid OOMs.
      However, this is done by first adding the KV into a local ArrayList and then copying the entries in this list to the final result list.

      In turns out the this temporary list is only used to keep track of the size of the result set in this loop. Can use a simple int instead.

      1. 6711-0.94-v1.txt
        2 kB
        Lars Hofhansl
      2. 6711-0.96-v1.txt
        3 kB
        Lars Hofhansl

        Activity

        Hide
        lhofhansl Lars Hofhansl added a comment -

        Here's a simple patch for that.
        The performance implications will typically be negligible here (except for extreme cases), but it reads better.

        Show
        lhofhansl Lars Hofhansl added a comment - Here's a simple patch for that. The performance implications will typically be negligible here (except for extreme cases), but it reads better.
        Hide
        lhofhansl Lars Hofhansl added a comment -

        Looks like HadoopQA is toast:

        At revision 1379915.
        HBASE-6711 patch is being downloaded at Sun Sep 2 05:01:45 UTC 2012 from
        http://issues.apache.org/jira/secure/attachment/12543466/6711-0.96-v1.txt
        cp: cannot stat `/home/jenkins/buildSupport/lib/*': No such file or directory

        Show
        lhofhansl Lars Hofhansl added a comment - Looks like HadoopQA is toast: At revision 1379915. HBASE-6711 patch is being downloaded at Sun Sep 2 05:01:45 UTC 2012 from http://issues.apache.org/jira/secure/attachment/12543466/6711-0.96-v1.txt cp: cannot stat `/home/jenkins/buildSupport/lib/*': No such file or directory
        Hide
        lhofhansl Lars Hofhansl added a comment -

        Trying once more.

        Show
        lhofhansl Lars Hofhansl added a comment - Trying once more.
        Hide
        hadoopqa Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12543619/6711-0.96-v1.txt
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 hadoop2.0. The patch compiles against the hadoop 2.0 profile.

        -1 javadoc. The javadoc tool appears to have generated 110 warning messages.

        -1 javac. The applied patch generated 5 javac compiler warnings (more than the trunk's current 4 warnings).

        -1 findbugs. The patch appears to introduce 7 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests:
        org.apache.hadoop.hbase.backup.example.TestZooKeeperTableArchiveClient
        org.apache.hadoop.hbase.client.TestFromClientSide
        org.apache.hadoop.hbase.regionserver.TestAtomicOperation

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12543619/6711-0.96-v1.txt against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 hadoop2.0. The patch compiles against the hadoop 2.0 profile. -1 javadoc. The javadoc tool appears to have generated 110 warning messages. -1 javac. The applied patch generated 5 javac compiler warnings (more than the trunk's current 4 warnings). -1 findbugs. The patch appears to introduce 7 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests: org.apache.hadoop.hbase.backup.example.TestZooKeeperTableArchiveClient org.apache.hadoop.hbase.client.TestFromClientSide org.apache.hadoop.hbase.regionserver.TestAtomicOperation Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2767//console This message is automatically generated.
        Hide
        lhofhansl Lars Hofhansl added a comment -

        I ran all the tests locally. All pass.
        Any objections to committing this? It's a simple change.

        Show
        lhofhansl Lars Hofhansl added a comment - I ran all the tests locally. All pass. Any objections to committing this? It's a simple change.
        Hide
        lhofhansl Lars Hofhansl added a comment -

        In a microbenchmark I do see improvements after all:
        Locally scanning rows with 10.000 columns... Variances are high, but without the patch each scan (including returning to the client) takes 9-13ms. With the patch it takes 8.5-10ms (averages per row).

        Show
        lhofhansl Lars Hofhansl added a comment - In a microbenchmark I do see improvements after all: Locally scanning rows with 10.000 columns... Variances are high, but without the patch each scan (including returning to the client) takes 9-13ms. With the patch it takes 8.5-10ms (averages per row).
        Hide
        eclark Elliott Clark added a comment -

        Looks good to me. Nice find.
        A lot of array lists are created all over the place. I wonder how many are un-needed like this one.

        Show
        eclark Elliott Clark added a comment - Looks good to me. Nice find. A lot of array lists are created all over the place. I wonder how many are un-needed like this one.
        Hide
        lhofhansl Lars Hofhansl added a comment -

        Probably a lot. We'll whack them one by one.

        Show
        lhofhansl Lars Hofhansl added a comment - Probably a lot. We'll whack them one by one.
        Hide
        lhofhansl Lars Hofhansl added a comment -

        Committed to 0.94 and 0.96.

        Show
        lhofhansl Lars Hofhansl added a comment - Committed to 0.94 and 0.96.
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-TRUNK #3302 (See https://builds.apache.org/job/HBase-TRUNK/3302/)
        HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380868)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Show
        hudson Hudson added a comment - Integrated in HBase-TRUNK #3302 (See https://builds.apache.org/job/HBase-TRUNK/3302/ ) HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380868) Result = FAILURE larsh : Files : /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-0.94 #448 (See https://builds.apache.org/job/HBase-0.94/448/)
        HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Show
        hudson Hudson added a comment - Integrated in HBase-0.94 #448 (See https://builds.apache.org/job/HBase-0.94/448/ ) HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867) Result = FAILURE larsh : Files : /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #159 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/159/)
        HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380868)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Show
        hudson Hudson added a comment - Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #159 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/159/ ) HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380868) Result = FAILURE larsh : Files : /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Hide
        stack stack added a comment -

        +1 on patch

        Show
        stack stack added a comment - +1 on patch
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-0.94-security #51 (See https://builds.apache.org/job/HBase-0.94-security/51/)
        HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Show
        hudson Hudson added a comment - Integrated in HBase-0.94-security #51 (See https://builds.apache.org/job/HBase-0.94-security/51/ ) HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867) Result = FAILURE larsh : Files : /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-0.94-security-on-Hadoop-23 #7 (See https://builds.apache.org/job/HBase-0.94-security-on-Hadoop-23/7/)
        HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Show
        hudson Hudson added a comment - Integrated in HBase-0.94-security-on-Hadoop-23 #7 (See https://builds.apache.org/job/HBase-0.94-security-on-Hadoop-23/7/ ) HBASE-6711 Avoid local results copy in StoreScanner (Revision 1380867) Result = FAILURE larsh : Files : /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
        Hide
        stack stack added a comment -

        Fix up after bulk move overwrote some 0.94.2 fix versions w/ 0.95.0 (Noticed by Lars Hofhansl)

        Show
        stack stack added a comment - Fix up after bulk move overwrote some 0.94.2 fix versions w/ 0.95.0 (Noticed by Lars Hofhansl)

          People

          • Assignee:
            lhofhansl Lars Hofhansl
            Reporter:
            lhofhansl Lars Hofhansl
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development