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

Remove some uses of obsolete guava APIs from the hadoop codebase

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      Along the same vein as HADOOP-11286, there are now several remaining usages of guava APIs that are now incompatible with a more recent version (e.g. 16).

      This JIRA proposes eliminating those usages. With this, the hadoop code base should run/compile cleanly even if guava 16 is used for example.

      This JIRA doesn't propose upgrading the guava dependency version however (just making the codebase compatible with guava 16+).

        Issue Links

          Activity

          Hide
          sjlee0 Sangjin Lee added a comment -

          I ran the hadoop unit tests against guava 16.0.1, and found that TestDFSClientCache.testEviction fails. I believe it is because the test relies on a particular behavior of guava 11.0.2 (more aggressive eviction of LocalCache) which is no longer the case in 16.0.1. I'll file a separate JIRA to fix up the test.

          Show
          sjlee0 Sangjin Lee added a comment - I ran the hadoop unit tests against guava 16.0.1, and found that TestDFSClientCache.testEviction fails. I believe it is because the test relies on a particular behavior of guava 11.0.2 (more aggressive eviction of LocalCache) which is no longer the case in 16.0.1. I'll file a separate JIRA to fix up the test.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2019 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2019/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2019 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2019/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #69 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/69/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #69 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/69/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #2000 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2000/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #2000 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2000/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #65 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/65/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #65 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/65/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Yarn-trunk #802 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/802/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #802 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/802/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #68 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/68/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #68 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/68/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          sjlee0 Sangjin Lee added a comment -
          Show
          sjlee0 Sangjin Lee added a comment - Thanks Colin P. McCabe !
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #6835 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6835/)
          HADOOP-11470. Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #6835 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6835/ ) HADOOP-11470 . Remove some uses of obsolete guava APIs from the hadoop codebase (Sangjin Lee via Colin P. McCabe) (cmccabe: rev ae91b13a4b1896b893268253104f935c3078d345) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java
          Hide
          cmccabe Colin P. McCabe added a comment -

          +1. Thanks, Sangjin

          The test failure is unrelated.

          Show
          cmccabe Colin P. McCabe added a comment - +1. Thanks, Sangjin The test failure is unrelated.
          Hide
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12690929/HADOOP-11470.001.patch
          against trunk revision cc2a745.

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

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

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

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

          org.apache.hadoop.hdfs.TestDecommission

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5383//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5383//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12690929/HADOOP-11470.001.patch against trunk revision cc2a745. +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.TestDecommission Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5383//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5383//console This message is automatically generated.
          Hide
          sjlee0 Sangjin Lee added a comment -

          Thanks Colin P. McCabe. It is certainly true that the code will build cleanly with guava 16+. Running correctly with newer guava is of course predicated on the assumption that the compatible parts of guava behave in the same way, which I haven't verified.

          Show
          sjlee0 Sangjin Lee added a comment - Thanks Colin P. McCabe . It is certainly true that the code will build cleanly with guava 16+. Running correctly with newer guava is of course predicated on the assumption that the compatible parts of guava behave in the same way, which I haven't verified.
          Hide
          cmccabe Colin P. McCabe added a comment -

          I have not verified that it allows running with a newer Guava, but the code changes certainly look reasonable. +1, pending jenkins

          For easier diff, see https://github.com/sjlee/hadoop/commit/636a2b534d6125bb92267f144d873792d4583b23

          I use "git patch viewer" for Chrome, which makes all JIRA patches appear with context. https://chrome.google.com/webstore/detail/git-patch-viewer/hkoggakcdopbgnaeeidcmopfekipkleg

          Show
          cmccabe Colin P. McCabe added a comment - I have not verified that it allows running with a newer Guava, but the code changes certainly look reasonable. +1, pending jenkins For easier diff, see https://github.com/sjlee/hadoop/commit/636a2b534d6125bb92267f144d873792d4583b23 I use "git patch viewer" for Chrome, which makes all JIRA patches appear with context. https://chrome.google.com/webstore/detail/git-patch-viewer/hkoggakcdopbgnaeeidcmopfekipkleg
          Hide
          sjlee0 Sangjin Lee added a comment -

          Patch posted. It's two APIs: Ranges and NullOutputStream. NullOutputStream is replaced by hadoop's own IOUtils.NullOutputStream. Ranges is replaced by Apache Commons' LongRange.

          For easier diff, see https://github.com/sjlee/hadoop/commit/636a2b534d6125bb92267f144d873792d4583b23

          Show
          sjlee0 Sangjin Lee added a comment - Patch posted. It's two APIs: Ranges and NullOutputStream. NullOutputStream is replaced by hadoop's own IOUtils.NullOutputStream. Ranges is replaced by Apache Commons' LongRange. For easier diff, see https://github.com/sjlee/hadoop/commit/636a2b534d6125bb92267f144d873792d4583b23

            People

            • Assignee:
              sjlee0 Sangjin Lee
              Reporter:
              sjlee0 Sangjin Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development