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

Remove duplicate or unused variable in appendFile()

    Details

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

      Description

      A new findbugs warning was reported (See HDFS-10745). branch-2.8 might have the same problem.

      Code	Warning
      DLS	Dead store to src in org.apache.hadoop.hdfs.server.namenode.FSDirAppendOp
        .appendFile(FSNamesystem, String, FSPermissionChecker, String, String, boolean, boolean)
      Bug type DLS_DEAD_LOCAL_STORE (click for details) 
      In class org.apache.hadoop.hdfs.server.namenode.FSDirAppendOp
      In method org.apache.hadoop.hdfs.server.namenode.FSDirAppendOp
        .appendFile(FSNamesystem, String, FSPermissionChecker, String, String, boolean, boolean)
      Local variable named src
      At FSDirAppendOp.java:[line 92]
      

        Activity

        Hide
        kihwal Kihwal Lee added a comment -

        Even in trunk, src is only used for a logging statement in the method. We can get rid of it.

        Show
        kihwal Kihwal Lee added a comment - Even in trunk, src is only used for a logging statement in the method. We can get rid of it.
        Hide
        kihwal Kihwal Lee added a comment -

        From https://builds.apache.org/job/PreCommit-Admin/263621

        HDFS-10841,12827212 has not been processed, submitting
        ERROR retrieving resource
         https://builds.apache.org/job/PreCommit-HDFS-Build/buildWithParameters?token=hadoopqa&ISSUE_NUM=10841&ATTACHMENT_ID=12827212:
         HTTP Error 503: Service Unavailable
        Archiving artifacts
        Compressed 99.73 KB of artifacts by 64.2% relative to #263620
        Finished: SUCCESS
        

        The precommit admin failed to submit the work for this jira, but the jira was ignored as "... has been processed, ignoring" in subsequent runs. Kicking it manually.

        Show
        kihwal Kihwal Lee added a comment - From https://builds.apache.org/job/PreCommit-Admin/263621 HDFS-10841,12827212 has not been processed, submitting ERROR retrieving resource https://builds.apache.org/job/PreCommit-HDFS-Build/buildWithParameters?token=hadoopqa&ISSUE_NUM=10841&ATTACHMENT_ID=12827212: HTTP Error 503: Service Unavailable Archiving artifacts Compressed 99.73 KB of artifacts by 64.2% relative to #263620 Finished: SUCCESS The precommit admin failed to submit the work for this jira, but the jira was ignored as "... has been processed, ignoring" in subsequent runs. Kicking it manually.
        Hide
        xiaochen Xiao Chen added a comment -

        Thanks Kihwal for taking care of this!

        The original problem only shows up in branch-2, because src is not used at all. Looking at this patch, I think it makes more sense to use path for logging and remove src. +1 pending jenkins.

        Show
        xiaochen Xiao Chen added a comment - Thanks Kihwal for taking care of this! The original problem only shows up in branch-2, because src is not used at all. Looking at this patch, I think it makes more sense to use path for logging and remove src . +1 pending jenkins.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 15s Docker mode activated.
        +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.
        +1 mvninstall 7m 12s trunk passed
        +1 compile 0m 50s trunk passed
        +1 checkstyle 0m 28s trunk passed
        +1 mvnsite 0m 58s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 48s trunk passed
        +1 javadoc 0m 57s trunk passed
        +1 mvninstall 0m 51s the patch passed
        +1 compile 0m 48s the patch passed
        +1 javac 0m 48s the patch passed
        +1 checkstyle 0m 25s the patch passed
        +1 mvnsite 0m 47s the patch passed
        +1 mvneclipse 0m 9s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 46s the patch passed
        +1 javadoc 0m 54s the patch passed
        +1 unit 60m 9s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 17s The patch does not generate ASF License warnings.
        80m 5s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10841
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827212/HDFS-10841.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux c07bd5b1522a 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 39d1b1d
        Default Java 1.8.0_101
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16648/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16648/console
        Powered by Apache Yetus 0.4.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 15s Docker mode activated. +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. +1 mvninstall 7m 12s trunk passed +1 compile 0m 50s trunk passed +1 checkstyle 0m 28s trunk passed +1 mvnsite 0m 58s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 48s trunk passed +1 javadoc 0m 57s trunk passed +1 mvninstall 0m 51s the patch passed +1 compile 0m 48s the patch passed +1 javac 0m 48s the patch passed +1 checkstyle 0m 25s the patch passed +1 mvnsite 0m 47s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 46s the patch passed +1 javadoc 0m 54s the patch passed +1 unit 60m 9s hadoop-hdfs in the patch passed. +1 asflicense 0m 17s The patch does not generate ASF License warnings. 80m 5s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10841 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827212/HDFS-10841.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux c07bd5b1522a 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 39d1b1d Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16648/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16648/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        xiaochen Xiao Chen added a comment -

        +1 on the patch, committing soon.

        Show
        xiaochen Xiao Chen added a comment - +1 on the patch, committing soon.
        Hide
        xiaochen Xiao Chen added a comment -

        Committed to trunk, branch-2 and branch-2.8. Backporting to branch-2 has a trivial conflict, compiled before pushing.

        Thanks Kihwal for the quick fix!

        Show
        xiaochen Xiao Chen added a comment - Committed to trunk, branch-2 and branch-2.8. Backporting to branch-2 has a trivial conflict, compiled before pushing. Thanks Kihwal for the quick fix!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10400 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10400/)
        HDFS-10841. Remove duplicate or unused variable in appendFile(). (xiao: rev f6c0b7543f612de756ff0c03e9a2c6e33b496a36)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAppendOp.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10400 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10400/ ) HDFS-10841 . Remove duplicate or unused variable in appendFile(). (xiao: rev f6c0b7543f612de756ff0c03e9a2c6e33b496a36) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAppendOp.java

          People

          • Assignee:
            kihwal Kihwal Lee
            Reporter:
            kihwal Kihwal Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development