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

Refactor the error handling code in DataStreamer

    Details

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

      Description

      DataStreamer handles (1) bad datanode, (2) restarting datanode and (3) datanode replacement and keeps various state and indexes. This issue is to clean up the code.

      1. HDFS-8397.002.patch
        32 kB
        Jing Zhao
      2. h8397_20150514.patch
        31 kB
        Tsz Wo Nicholas Sze
      3. h8397_20150513.patch
        31 kB
        Tsz Wo Nicholas Sze

        Activity

        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        Jing Zhao and Haohui Mai, thanks for reviewing and committing the patch.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - Jing Zhao and Haohui Mai , thanks for reviewing and committing the patch.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2145 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2145/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2145 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2145/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #197 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/197/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #197 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/197/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #187 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/187/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #187 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/187/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2127 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2127/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2127 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2127/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #929 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/929/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #929 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/929/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #198 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/198/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #198 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/198/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #7843 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7843/)
        HDFS-8397. Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7843 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7843/ ) HDFS-8397 . Refactor the error handling code in DataStreamer. Contributed by Tsz Wo Nicholas Sze. (jing9: rev 8f378733423a5244461df79a92c00239514b8b93) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Hide
        jingzhao Jing Zhao added a comment -

        Thanks Nicholas for the contribution, and Haohui for the review. I've committed this to trunk and branch-2.

        Show
        jingzhao Jing Zhao added a comment - Thanks Nicholas for the contribution, and Haohui for the review. I've committed this to trunk and branch-2.
        Hide
        wheat9 Haohui Mai added a comment -

        +1

        Show
        wheat9 Haohui Mai added a comment - +1
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 39s 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 7m 30s There were no new javac warning messages.
        +1 javadoc 9m 33s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 50s There were no new checkstyle issues.
        +1 whitespace 0m 1s The patch has no lines that end in whitespace.
        +1 install 1m 36s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 3m 5s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 native 3m 14s Pre-build of native portion
        +1 hdfs tests 167m 45s Tests passed in hadoop-hdfs.
            209m 13s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12733217/HDFS-8397.002.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 03a293a
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11011/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11011/testReport/
        Java 1.7.0_55
        uname Linux asf901.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/11011/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 39s 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 7m 30s There were no new javac warning messages. +1 javadoc 9m 33s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 50s There were no new checkstyle issues. +1 whitespace 0m 1s The patch has no lines that end in whitespace. +1 install 1m 36s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 3m 5s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 native 3m 14s Pre-build of native portion +1 hdfs tests 167m 45s Tests passed in hadoop-hdfs.     209m 13s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12733217/HDFS-8397.002.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 03a293a hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11011/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11011/testReport/ Java 1.7.0_55 uname Linux asf901.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/11011/console This message was automatically generated.
        Hide
        jingzhao Jing Zhao added a comment -

        Since the suggested change is trivial, I just updated the patch for Nicholas.

        Show
        jingzhao Jing Zhao added a comment - Since the suggested change is trivial, I just updated the patch for Nicholas.
        Hide
        jingzhao Jing Zhao added a comment -

        Thanks for the refactoring, Nicholas! The patch looks pretty good to me. Only some minors:

        1. setRestartingNodeIndex has not been used
        2. The value error is always false in the following code
                  if (!error) {
                    throw new IllegalStateException("error=" + error);
                  }
          
        3. Looks like checkRestartingNodeDeadline can return void.
                if (errorState.checkRestartingNodeDeadline(nodes)) {
                  continue; // within the deadline
                }
          
        4. Need to fix the checkstyle and whitespace warnings.

        +1 after addressing the comments.

        Show
        jingzhao Jing Zhao added a comment - Thanks for the refactoring, Nicholas! The patch looks pretty good to me. Only some minors: setRestartingNodeIndex has not been used The value error is always false in the following code if (!error) { throw new IllegalStateException( "error=" + error); } Looks like checkRestartingNodeDeadline can return void. if (errorState.checkRestartingNodeDeadline(nodes)) { continue ; // within the deadline } Need to fix the checkstyle and whitespace warnings. +1 after addressing the comments.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 40s 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 7m 32s There were no new javac warning messages.
        +1 javadoc 9m 43s There were no new javadoc warning messages.
        +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings.
        -1 checkstyle 2m 13s The applied patch generated 3 new checkstyle issues (total was 93, now 84).
        -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix.
        +1 install 1m 33s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 3m 8s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 native 3m 16s Pre-build of native portion
        -1 hdfs tests 183m 44s Tests failed in hadoop-hdfs.
            226m 47s  



        Reason Tests
        Failed unit tests hadoop.tools.TestHdfsConfigFields
        Timed out tests org.apache.hadoop.hdfs.server.namenode.TestBackupNode



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12732948/h8397_20150514.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 15ccd96
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/diffcheckstylehadoop-hdfs.txt
        whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/whitespace.txt
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10985/testReport/
        Java 1.7.0_55
        uname Linux asf900.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/10985/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 40s 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 7m 32s There were no new javac warning messages. +1 javadoc 9m 43s There were no new javadoc warning messages. +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings. -1 checkstyle 2m 13s The applied patch generated 3 new checkstyle issues (total was 93, now 84). -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix. +1 install 1m 33s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 3m 8s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 native 3m 16s Pre-build of native portion -1 hdfs tests 183m 44s Tests failed in hadoop-hdfs.     226m 47s   Reason Tests Failed unit tests hadoop.tools.TestHdfsConfigFields Timed out tests org.apache.hadoop.hdfs.server.namenode.TestBackupNode Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12732948/h8397_20150514.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 15ccd96 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/diffcheckstylehadoop-hdfs.txt whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/whitespace.txt hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10985/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10985/testReport/ Java 1.7.0_55 uname Linux asf900.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/10985/console This message was automatically generated.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        h8397_20150514.patch: fixes some bugs.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - h8397_20150514.patch: fixes some bugs.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        h8397_20150513.patch: adds a new class ErrorState and a few methods.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - h8397_20150513.patch: adds a new class ErrorState and a few methods.

          People

          • Assignee:
            szetszwo Tsz Wo Nicholas Sze
            Reporter:
            szetszwo Tsz Wo Nicholas Sze
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development