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

Improve performance of getting and removing inode features

    Details

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

      Description

      Getting a feature uses an iterator which is less performant than an indexed for loop. Feature lookups are becoming more prolific so cycles count.

      Removing a feature requires building a string for up to 3 precondition checks. The worst case of 3 is the penalty for a successful removal.

        Activity

        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 13s Docker mode activated.
              Prechecks
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 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.
              trunk Compile Tests
        +1 mvninstall 13m 56s trunk passed
        +1 compile 0m 48s trunk passed
        +1 checkstyle 0m 35s trunk passed
        +1 mvnsite 0m 53s trunk passed
        -1 findbugs 1m 39s hadoop-hdfs-project/hadoop-hdfs in trunk has 10 extant Findbugs warnings.
        +1 javadoc 0m 39s trunk passed
              Patch Compile Tests
        +1 mvninstall 0m 49s the patch passed
        +1 compile 0m 44s the patch passed
        +1 javac 0m 44s the patch passed
        +1 checkstyle 0m 32s the patch passed
        +1 mvnsite 0m 50s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 43s the patch passed
        +1 javadoc 0m 37s the patch passed
              Other Tests
        +1 unit 66m 22s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 22s The patch does not generate ASF License warnings.
        91m 56s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue HDFS-12143
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12877330/HDFS-12143.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 7a22519594eb 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 75c0220
        Default Java 1.8.0_131
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-HDFS-Build/20275/artifact/patchprocess/branch-findbugs-hadoop-hdfs-project_hadoop-hdfs-warnings.html
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20275/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20275/console
        Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 13s Docker mode activated.       Prechecks +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 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.       trunk Compile Tests +1 mvninstall 13m 56s trunk passed +1 compile 0m 48s trunk passed +1 checkstyle 0m 35s trunk passed +1 mvnsite 0m 53s trunk passed -1 findbugs 1m 39s hadoop-hdfs-project/hadoop-hdfs in trunk has 10 extant Findbugs warnings. +1 javadoc 0m 39s trunk passed       Patch Compile Tests +1 mvninstall 0m 49s the patch passed +1 compile 0m 44s the patch passed +1 javac 0m 44s the patch passed +1 checkstyle 0m 32s the patch passed +1 mvnsite 0m 50s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 43s the patch passed +1 javadoc 0m 37s the patch passed       Other Tests +1 unit 66m 22s hadoop-hdfs in the patch passed. +1 asflicense 0m 22s The patch does not generate ASF License warnings. 91m 56s Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue HDFS-12143 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12877330/HDFS-12143.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 7a22519594eb 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 75c0220 Default Java 1.8.0_131 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-HDFS-Build/20275/artifact/patchprocess/branch-findbugs-hadoop-hdfs-project_hadoop-hdfs-warnings.html Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20275/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20275/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        shahrs87 Rushabh S Shah added a comment - - edited

        Daryn Sharp: Overall the patch looks good.
        The following comment has nothing to do with your patch.
        It was this way before the patch also.

        INodeWithAdditionalFields.java
        protected void removeFeature(Feature f)
        {
          ...
           if (overflow || j != size - 1) {
              throwFeatureNotFoundException(f);
            }
          ...
        }
        

        j is not equal to size-1, only if we found multiple features since we break out when j == size-1.
        We can create different jira to fix this or if you can incorporate in this jira, it would be great.

        Show
        shahrs87 Rushabh S Shah added a comment - - edited Daryn Sharp : Overall the patch looks good. The following comment has nothing to do with your patch. It was this way before the patch also. INodeWithAdditionalFields.java protected void removeFeature(Feature f) { ... if (overflow || j != size - 1) { throwFeatureNotFoundException(f); } ... } j is not equal to size-1 , only if we found multiple features since we break out when j == size-1. We can create different jira to fix this or if you can incorporate in this jira, it would be great.
        Hide
        daryn Daryn Sharp added a comment -

        This patch is intended to surgically fix the unnecessary performance degradation caused by preconditions. The mathematical comparisons, dubious as they may be, are not part of the problem.

        Show
        daryn Daryn Sharp added a comment - This patch is intended to surgically fix the unnecessary performance degradation caused by preconditions. The mathematical comparisons, dubious as they may be, are not part of the problem.
        Hide
        kihwal Kihwal Lee added a comment -

        Rushabh S Shah, please file a separate jira if you feel the issue is worth fixing.

        +1 for the patch.

        Show
        kihwal Kihwal Lee added a comment - Rushabh S Shah , please file a separate jira if you feel the issue is worth fixing. +1 for the patch.
        Hide
        kihwal Kihwal Lee added a comment -

        I've committed this to trunk, branch-2 and branch-2.8.

        Show
        kihwal Kihwal Lee added a comment - I've committed this to trunk, branch-2 and branch-2.8.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12053 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12053/)
        HDFS-12143. Improve performance of getting and removing inode features. (kihwal: rev 1a79dcfc457969d6a6c08ffffe4152fd7638e48a)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12053 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12053/ ) HDFS-12143 . Improve performance of getting and removing inode features. (kihwal: rev 1a79dcfc457969d6a6c08ffffe4152fd7638e48a) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java
        Hide
        xkrogen Erik Krogen added a comment -

        Hey Daryn Sharp, do you have any benchmark numbers to estimate how much performance increase the readability regression of foreach -> indexed brings? Finding a source which demonstrated the indexed form being faster than foreach was a little tough among many SO posts claiming they're equal. I'm curious if the benefits are amplified or diminished because of the small size of the array?

        Show
        xkrogen Erik Krogen added a comment - Hey Daryn Sharp , do you have any benchmark numbers to estimate how much performance increase the readability regression of foreach -> indexed brings? Finding a source which demonstrated the indexed form being faster than foreach was a little tough among many SO posts claiming they're equal. I'm curious if the benefits are amplified or diminished because of the small size of the array?

          People

          • Assignee:
            daryn Daryn Sharp
            Reporter:
            daryn Daryn Sharp
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development