Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8988

Use LightWeightHashSet instead of LightWeightLinkedSet in BlockManager#excessReplicateMap

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      public final Map<String, LightWeightLinkedSet<Block>> excessReplicateMap = new HashMap<>();
      

      LightWeightLinkedSet extends LightWeightHashSet and in addition it stores elements in double linked list to ensure ordered traversal. So it requires more memory for each entry (2 references = 8 + 8 bytes = 16 bytes, assume 64-bits system/JVM).
      I have traversed the source code, and we don't need ordered traversal for excess replicated blocks, so could use LightWeightHashSet to save memory.

      1. HDFS-8988.001.patch
        6 kB
        Yi Liu
      2. HDFS-8988.002.patch
        6 kB
        Yi Liu

        Activity

        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #484 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/484/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #484 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/484/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2422 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2422/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2422 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2422/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #1249 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1249/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1249 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1249/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #523 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/523/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #523 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/523/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #2457 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2457/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2457 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2457/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #511 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/511/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #511 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/511/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8610 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8610/)
        HDFS-8988. Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8610 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8610/ ) HDFS-8988 . Use LightWeightHashSet instead of LightWeightLinkedSet in (yliu: rev 73b86a5046fe3262dde7b05be46b18575e35fd5f) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hitliuyi Yi Liu added a comment -

        Committed to trunk and branch-2.

        Show
        hitliuyi Yi Liu added a comment - Committed to trunk and branch-2.
        Hide
        hitliuyi Yi Liu added a comment -

        Thanks Uma Maheswara Rao G for the review, the test failure are not related and can pass locally.
        I will fix the checkstyle about one line is longer than 80 characters while committing.

        Show
        hitliuyi Yi Liu added a comment - Thanks Uma Maheswara Rao G for the review, the test failure are not related and can pass locally. I will fix the checkstyle about one line is longer than 80 characters while committing.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 18m 56s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s 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 javac 8m 15s There were no new javac warning messages.
        +1 javadoc 10m 38s There were no new javadoc warning messages.
        -1 release audit 0m 19s The applied patch generated 1 release audit warnings.
        -1 checkstyle 1m 26s The applied patch generated 2 new checkstyle issues (total was 283, now 283).
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 32s mvn install still works.
        +1 eclipse:eclipse 0m 36s The patch built with eclipse:eclipse.
        +1 findbugs 2m 33s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 20s Pre-build of native portion
        -1 hdfs tests 231m 49s Tests failed in hadoop-hdfs.
            279m 27s  



        Reason Tests
        Failed unit tests hadoop.hdfs.server.blockmanagement.TestNodeCount
          hadoop.hdfs.TestReplaceDatanodeOnFailure
          hadoop.hdfs.server.balancer.TestBalancerWithMultipleNameNodes



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12765949/HDFS-8988.002.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / fa5a54c
        Release Audit https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/patchReleaseAuditProblems.txt
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/diffcheckstylehadoop-hdfs.txt
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12917/testReport/
        Java 1.7.0_55
        uname Linux asf905.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12917/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 18m 56s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s 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 javac 8m 15s There were no new javac warning messages. +1 javadoc 10m 38s There were no new javadoc warning messages. -1 release audit 0m 19s The applied patch generated 1 release audit warnings. -1 checkstyle 1m 26s The applied patch generated 2 new checkstyle issues (total was 283, now 283). +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 32s mvn install still works. +1 eclipse:eclipse 0m 36s The patch built with eclipse:eclipse. +1 findbugs 2m 33s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 20s Pre-build of native portion -1 hdfs tests 231m 49s Tests failed in hadoop-hdfs.     279m 27s   Reason Tests Failed unit tests hadoop.hdfs.server.blockmanagement.TestNodeCount   hadoop.hdfs.TestReplaceDatanodeOnFailure   hadoop.hdfs.server.balancer.TestBalancerWithMultipleNameNodes Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12765949/HDFS-8988.002.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / fa5a54c Release Audit https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/patchReleaseAuditProblems.txt checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/diffcheckstylehadoop-hdfs.txt hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12917/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12917/testReport/ Java 1.7.0_55 uname Linux asf905.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12917/console This message was automatically generated.
        Hide
        umamaheswararao Uma Maheswara Rao G added a comment -

        Thanks Yi. Yes, I think we don't need ordered in excessReplicates, SO it make sense to have LightWeightHashSet.

        +1 pending jenkins.

        Show
        umamaheswararao Uma Maheswara Rao G added a comment - Thanks Yi. Yes, I think we don't need ordered in excessReplicates, SO it make sense to have LightWeightHashSet. +1 pending jenkins.
        Hide
        hitliuyi Yi Liu added a comment -

        Rebase the patch.

        Show
        hitliuyi Yi Liu added a comment - Rebase the patch.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 pre-patch 16m 32s Findbugs (version ) appears to be broken on trunk.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s 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 javac 8m 0s There were no new javac warning messages.
        +1 javadoc 10m 10s There were no new javadoc warning messages.
        +1 release audit 0m 25s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 31s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 42s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 2m 31s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 15s Pre-build of native portion
        -1 hdfs tests 188m 53s Tests failed in hadoop-hdfs.
            232m 35s  



        Reason Tests
        Failed unit tests hadoop.hdfs.server.datanode.fsdataset.impl.TestLazyPersistFiles
          hadoop.hdfs.TestRollingUpgrade



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12752942/HDFS-8988.001.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / e166c03
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12192/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12192/testReport/
        Java 1.7.0_55
        uname Linux asf909.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12192/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 pre-patch 16m 32s Findbugs (version ) appears to be broken on trunk. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s 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 javac 8m 0s There were no new javac warning messages. +1 javadoc 10m 10s There were no new javadoc warning messages. +1 release audit 0m 25s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 31s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 42s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 2m 31s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 15s Pre-build of native portion -1 hdfs tests 188m 53s Tests failed in hadoop-hdfs.     232m 35s   Reason Tests Failed unit tests hadoop.hdfs.server.datanode.fsdataset.impl.TestLazyPersistFiles   hadoop.hdfs.TestRollingUpgrade Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12752942/HDFS-8988.001.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / e166c03 hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12192/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12192/testReport/ Java 1.7.0_55 uname Linux asf909.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12192/console This message was automatically generated.

          People

          • Assignee:
            hitliuyi Yi Liu
            Reporter:
            hitliuyi Yi Liu
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development