Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1763

Replace hard-coded option strings with variables from DFSConfigKeys

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      There are some places in the code where we use hard-coded strings instead of the equivalent DFSConfigKeys define, and a couple places where the default is defined multiple places (once in DFSConfigKeys and once elsewhere, though both have the same value). This is error-prone, and also a pain in that it prevents eclipse from easily showing you all the places where a particular config option is used. Let's replace all the uses of the hard-coded option strings with uses of the corresponding variables in DFSConfigKeys.

      1. hdfs-1763-2.patch
        92 kB
        Eli Collins
      2. hdfs-1763-1.patch
        96 kB
        Eli Collins

        Issue Links

          Activity

          Hide
          Eli Collins added a comment -

          Patch attached.

          Show
          Eli Collins added a comment - Patch attached.
          Hide
          Todd Lipcon added a comment -

          Looks good - went through looking for bloopers and didn't see any. In 3 or 4 tests, they were setting dfs.block.size and now are setting the correct dfs.blocksize - it's probably the correct change, but worth being aware of that we're changing behavior of those tests.

          Show
          Todd Lipcon added a comment - Looks good - went through looking for bloopers and didn't see any. In 3 or 4 tests, they were setting dfs.block.size and now are setting the correct dfs.blocksize - it's probably the correct change, but worth being aware of that we're changing behavior of those tests.
          Hide
          Todd Lipcon added a comment -

          (+1 when test results come back)

          Show
          Todd Lipcon added a comment - (+1 when test results come back)
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12473881/hdfs-1763-1.patch
          against trunk revision 1082263.

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

          +1 tests included. The patch appears to include 162 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          -1 javac. The patch appears to cause tar ant target to fail.

          +1 findbugs. The patch does not introduce any 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 core unit tests:

          -1 contrib tests. The patch failed contrib unit tests.

          -1 system test framework. The patch failed system test framework compile.

          Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//testReport/
          Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12473881/hdfs-1763-1.patch against trunk revision 1082263. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 162 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. -1 javac. The patch appears to cause tar ant target to fail. +1 findbugs. The patch does not introduce any 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 core unit tests: -1 contrib tests. The patch failed contrib unit tests. -1 system test framework. The patch failed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/273//console This message is automatically generated.
          Hide
          Eli Collins added a comment -

          Patch attached (minor update of last one that missed a couple imports of DFSConfigKeys in tests).

          Show
          Eli Collins added a comment - Patch attached (minor update of last one that missed a couple imports of DFSConfigKeys in tests).
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12474023/hdfs-1763-2.patch
          against trunk revision 1083021.

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

          +1 tests included. The patch appears to include 165 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any 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 core unit tests:

          -1 contrib tests. The patch failed contrib unit tests.

          +1 system test framework. The patch passed system test framework compile.

          Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//testReport/
          Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12474023/hdfs-1763-2.patch against trunk revision 1083021. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 165 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any 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 core unit tests: -1 contrib tests. The patch failed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/274//console This message is automatically generated.
          Hide
          Eli Collins added a comment -

          Test failure is HDFS-1666 (hdfsproxy).

          Show
          Eli Collins added a comment - Test failure is HDFS-1666 (hdfsproxy).
          Hide
          Eli Collins added a comment -

          I've committed this.

          Show
          Eli Collins added a comment - I've committed this.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #564 (See https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/564/)
          HDFS-1763. Replace hard-coded option strings with variables from DFSConfigKeys. Contributed by Eli Collins

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #564 (See https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/564/ ) HDFS-1763 . Replace hard-coded option strings with variables from DFSConfigKeys. Contributed by Eli Collins
          Hide
          Tsz Wo Nicholas Sze added a comment -

          Hi Eli, there are some compilation errors in build #274. I also saw it in my machine after svn update.

               [exec] -compile-fault-inject:
               [exec]      [echo] Start weaving aspects in place
               [exec]      [iajc] /grid/0/hudson/hudson-slave/workspace/PreCommit-HDFS-Build/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java:63 [error] DFSConfigKeys cannot be resolved
               [exec]      [iajc] CONF.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 1);
               [exec]      [iajc]              ^^^^^^^^
               [exec]      [iajc] 
               [exec]      [iajc] 1 error
               [exec] 
               [exec] BUILD FAILED
          
          Show
          Tsz Wo Nicholas Sze added a comment - Hi Eli, there are some compilation errors in build #274 . I also saw it in my machine after svn update. [exec] -compile-fault-inject: [exec] [echo] Start weaving aspects in place [exec] [iajc] /grid/0/hudson/hudson-slave/workspace/PreCommit-HDFS-Build/trunk/src/test/aop/org/apache/hadoop/fs/TestFiRename.java:63 [error] DFSConfigKeys cannot be resolved [exec] [iajc] CONF.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 1); [exec] [iajc] ^^^^^^^^ [exec] [iajc] [exec] [iajc] 1 error [exec] [exec] BUILD FAILED
          Hide
          Eli Collins added a comment -

          Thanks Nicholas, I've committed the fix (TestFiRename just needed to import DFSConfigKeys).

          I forgot that compile-fault-inject does not run as part of test-patch and Hudson. Filed HADOOP-7200 to cover that so we won't get positive runs from Hudson if the patch causes the FI tests to not compile.

          Show
          Eli Collins added a comment - Thanks Nicholas, I've committed the fix (TestFiRename just needed to import DFSConfigKeys). I forgot that compile-fault-inject does not run as part of test-patch and Hudson. Filed HADOOP-7200 to cover that so we won't get positive runs from Hudson if the patch causes the FI tests to not compile.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #565 (See https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/565/)
          Add import missed in HDFS-1763.

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #565 (See https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/565/ ) Add import missed in HDFS-1763 .
          Hide
          Tsz Wo Nicholas Sze added a comment -

          No problem. Good work, Eli!

          Show
          Tsz Wo Nicholas Sze added a comment - No problem. Good work, Eli!
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #643 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/643/)

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #643 (See https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/643/ )

            People

            • Assignee:
              Eli Collins
              Reporter:
              Eli Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development