Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13658

Replace config key literal strings with config key names I: hadoop common

    Details

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

      Description

      In Hadoop Common, there are several places where the config keys are used by the literal strings instead of their names as in configuration key classes. The default values have the same issue. For example

      in o.a.h.i.f.t.Compression.java
      conf.setInt("io.compression.codec.lzo.buffersize", 64 * 1024);
      

      should be

      conf.setInt(
          CommonConfigurationKeys.IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY,
          CommonConfigurationKeys.IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_DEFAULT);
      

      instead

      1. HADOOP-13658.001.patch
        3 kB
        Chen Liang
      2. HADOOP-13658.002.patch
        25 kB
        Chen Liang
      3. HADOOP-13658.003.patch
        25 kB
        Chen Liang

        Issue Links

          Activity

          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 19s 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 59s trunk passed
          +1 compile 8m 22s trunk passed
          +1 checkstyle 0m 24s trunk passed
          +1 mvnsite 1m 2s trunk passed
          +1 mvneclipse 0m 14s trunk passed
          +1 findbugs 1m 30s trunk passed
          +1 javadoc 0m 47s trunk passed
          +1 mvninstall 0m 43s the patch passed
          +1 compile 8m 20s the patch passed
          +1 javac 8m 20s the patch passed
          +1 checkstyle 0m 26s the patch passed
          +1 mvnsite 1m 3s the patch passed
          +1 mvneclipse 0m 13s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 47s the patch passed
          +1 javadoc 0m 52s the patch passed
          +1 unit 8m 10s hadoop-common in the patch passed.
          +1 asflicense 0m 23s The patch does not generate ASF License warnings.
          44m 5s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HADOOP-13658
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830370/HADOOP-13658.001.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux bad8987451d6 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 3ae652f
          Default Java 1.8.0_101
          findbugs v3.0.0
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10598/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10598/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 19s 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 59s trunk passed +1 compile 8m 22s trunk passed +1 checkstyle 0m 24s trunk passed +1 mvnsite 1m 2s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 1m 30s trunk passed +1 javadoc 0m 47s trunk passed +1 mvninstall 0m 43s the patch passed +1 compile 8m 20s the patch passed +1 javac 8m 20s the patch passed +1 checkstyle 0m 26s the patch passed +1 mvnsite 1m 3s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 47s the patch passed +1 javadoc 0m 52s the patch passed +1 unit 8m 10s hadoop-common in the patch passed. +1 asflicense 0m 23s The patch does not generate ASF License warnings. 44m 5s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13658 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830370/HADOOP-13658.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux bad8987451d6 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 3ae652f Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10598/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10598/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          liuml07 Mingliang Liu added a comment -

          Can you use the static import if possible? That way the code will be shorter without verbose line breaks like following:

          212	                                  conf.getInt(CommonConfigurationKeysPublic
          213	                                          .IO_FILE_BUFFER_SIZE_KEY,
          214	                                      CommonConfigurationKeysPublic
          215	                                          .IO_FILE_BUFFER_SIZE_DEFAULT));
          

          Otherwise +1. Thanks.

          Show
          liuml07 Mingliang Liu added a comment - Can you use the static import if possible? That way the code will be shorter without verbose line breaks like following: 212 conf.getInt(CommonConfigurationKeysPublic 213 .IO_FILE_BUFFER_SIZE_KEY, 214 CommonConfigurationKeysPublic 215 .IO_FILE_BUFFER_SIZE_DEFAULT)); Otherwise +1. Thanks.
          Hide
          vagarychen Chen Liang added a comment -

          Thanks Mingliang Liu for the review and the comments! Uploaded v003 patch to use static import instead.

          Show
          vagarychen Chen Liang added a comment - Thanks Mingliang Liu for the review and the comments! Uploaded v003 patch to use static import instead.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 18s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 7m 40s trunk passed
          +1 compile 7m 37s trunk passed
          +1 checkstyle 0m 29s trunk passed
          +1 mvnsite 0m 55s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 1m 18s trunk passed
          +1 javadoc 0m 44s trunk passed
          +1 mvninstall 0m 37s the patch passed
          +1 compile 7m 0s the patch passed
          +1 javac 7m 0s the patch passed
          +1 checkstyle 0m 29s the patch passed
          +1 mvnsite 0m 56s the patch passed
          +1 mvneclipse 0m 13s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 40s the patch passed
          +1 javadoc 0m 47s the patch passed
          -1 unit 7m 47s hadoop-common in the patch failed.
          +1 asflicense 0m 21s The patch does not generate ASF License warnings.
          40m 34s



          Reason Tests
          Failed junit tests hadoop.net.TestDNS



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HADOOP-13658
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830591/HADOOP-13658.002.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 593046dc33c0 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 2acfb1e
          Default Java 1.8.0_101
          findbugs v3.0.0
          unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/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 18s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 40s trunk passed +1 compile 7m 37s trunk passed +1 checkstyle 0m 29s trunk passed +1 mvnsite 0m 55s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 18s trunk passed +1 javadoc 0m 44s trunk passed +1 mvninstall 0m 37s the patch passed +1 compile 7m 0s the patch passed +1 javac 7m 0s the patch passed +1 checkstyle 0m 29s the patch passed +1 mvnsite 0m 56s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 40s the patch passed +1 javadoc 0m 47s the patch passed -1 unit 7m 47s hadoop-common in the patch failed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 40m 34s Reason Tests Failed junit tests hadoop.net.TestDNS Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13658 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830591/HADOOP-13658.002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 593046dc33c0 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 2acfb1e Default Java 1.8.0_101 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10619/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          liuml07 Mingliang Liu added a comment -

          +1 v3 patch pending on Jenkins.

          Show
          liuml07 Mingliang Liu added a comment - +1 v3 patch pending on 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 appears to include 1 new or modified test files.
          +1 mvninstall 7m 12s trunk passed
          +1 compile 7m 22s trunk passed
          +1 checkstyle 0m 31s trunk passed
          +1 mvnsite 1m 0s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 1m 21s trunk passed
          +1 javadoc 0m 45s trunk passed
          +1 mvninstall 0m 39s the patch passed
          +1 compile 7m 16s the patch passed
          +1 javac 7m 16s the patch passed
          +1 checkstyle 0m 29s the patch passed
          +1 mvnsite 0m 56s the patch passed
          +1 mvneclipse 0m 13s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 30s the patch passed
          +1 javadoc 0m 46s the patch passed
          +1 unit 7m 39s hadoop-common in the patch passed.
          +1 asflicense 0m 21s The patch does not generate ASF License warnings.
          39m 55s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HADOOP-13658
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830594/HADOOP-13658.003.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux bcfb6c4562a1 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 2acfb1e
          Default Java 1.8.0_101
          findbugs v3.0.0
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10620/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10620/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 appears to include 1 new or modified test files. +1 mvninstall 7m 12s trunk passed +1 compile 7m 22s trunk passed +1 checkstyle 0m 31s trunk passed +1 mvnsite 1m 0s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 21s trunk passed +1 javadoc 0m 45s trunk passed +1 mvninstall 0m 39s the patch passed +1 compile 7m 16s the patch passed +1 javac 7m 16s the patch passed +1 checkstyle 0m 29s the patch passed +1 mvnsite 0m 56s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 30s the patch passed +1 javadoc 0m 46s the patch passed +1 unit 7m 39s hadoop-common in the patch passed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 39m 55s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13658 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830594/HADOOP-13658.003.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux bcfb6c4562a1 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 2acfb1e Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10620/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10620/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          liuml07 Mingliang Liu added a comment -

          Thanks Chen Liang for your contribution. I have committed this patch to trunk, branch-2 and branch-2.8.

          Show
          liuml07 Mingliang Liu added a comment - Thanks Chen Liang for your contribution. I have committed this patch to trunk , branch-2 and branch-2.8 .
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10502 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10502/)
          HADOOP-13658. Replace config key literal strings with names I: hadoop (liuml07: rev 9a44a832a99eb967aa4e34338dfa75baf35f9845)

          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/BloomMapFile.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java
          • (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/ContractTestUtils.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/DefaultCodec.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/SocksSocketFactory.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/hash/Hash.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/GzipCodec.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Compression.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/BZip2Codec.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/LineReader.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10502 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10502/ ) HADOOP-13658 . Replace config key literal strings with names I: hadoop (liuml07: rev 9a44a832a99eb967aa4e34338dfa75baf35f9845) (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/BloomMapFile.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapFile.java (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/ContractTestUtils.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/DefaultCodec.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/SocksSocketFactory.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/hash/Hash.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/GzipCodec.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Compression.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/BZip2Codec.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/LineReader.java

            People

            • Assignee:
              vagarychen Chen Liang
              Reporter:
              vagarychen Chen Liang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development