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

ConfServlet should respect Accept request header

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha2
    • Component/s: conf
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      Conf HTTP service should set response's content type according to the Accept header in the request.

      Description

      ConfServlet provides a general service to retrieve daemon configurations. However it doesn't set response content-type according to Accept header. For example, by issuing following command,

      curl --header "Accept:application/json" http://${resourcemanager_host}:8088/conf
      

      I am expecting the response would be in JSON format, however it is still in XML. I can only get JSON if I issue

      curl http://${resourcemanager_host}:8088/conf?format="json"
      

      This is not the common way how clients set content-type.

      1. HADOOP-13588.001.patch
        4 kB
        Weiwei Yang
      2. HADOOP-13588.002.patch
        4 kB
        Weiwei Yang

        Activity

        Hide
        cheersyang Weiwei Yang added a comment -

        Mark this one as incompatible change because it changes way of how clients send http request to get different content types from http response.

        Show
        cheersyang Weiwei Yang added a comment - Mark this one as incompatible change because it changes way of how clients send http request to get different content types from http response.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 17s 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 6m 38s trunk passed
        +1 compile 6m 52s trunk passed
        +1 checkstyle 0m 23s trunk passed
        +1 mvnsite 0m 56s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 23s trunk passed
        +1 javadoc 0m 46s trunk passed
        +1 mvninstall 0m 40s the patch passed
        +1 compile 7m 42s the patch passed
        +1 javac 7m 42s the patch passed
        +1 checkstyle 0m 26s the patch passed
        +1 mvnsite 1m 7s the patch passed
        +1 mvneclipse 0m 14s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 39s the patch passed
        +1 javadoc 0m 43s the patch passed
        +1 unit 10m 52s hadoop-common in the patch passed.
        +1 asflicense 0m 21s The patch does not generate ASF License warnings.
        42m 33s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HADOOP-13588
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827606/HADOOP-13588.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 263b5be03a41 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
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 2d1bf53
        Default Java 1.8.0_101
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10462/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10462/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 17s 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 6m 38s trunk passed +1 compile 6m 52s trunk passed +1 checkstyle 0m 23s trunk passed +1 mvnsite 0m 56s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 23s trunk passed +1 javadoc 0m 46s trunk passed +1 mvninstall 0m 40s the patch passed +1 compile 7m 42s the patch passed +1 javac 7m 42s the patch passed +1 checkstyle 0m 26s the patch passed +1 mvnsite 1m 7s the patch passed +1 mvneclipse 0m 14s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 39s the patch passed +1 javadoc 0m 43s the patch passed +1 unit 10m 52s hadoop-common in the patch passed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 42m 33s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13588 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827606/HADOOP-13588.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 263b5be03a41 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 2d1bf53 Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10462/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10462/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 add @VisibleForTesting annotation to parseAccecptHeader() method? Otherwise +1 for the patch. I'll leave this open for 2nd opinion as it's incompatible change.

        Show
        liuml07 Mingliang Liu added a comment - Can you add @VisibleForTesting annotation to parseAccecptHeader() method? Otherwise +1 for the patch. I'll leave this open for 2nd opinion as it's incompatible change.
        Hide
        cheersyang Weiwei Yang added a comment -

        Hello Mingliang Liu

        Thank you for reviewing this, I added @VisibleForTesting like you suggested and uploaded v2 patch.
        Well this is an incompatible change but I think it's more like a bug fix. I checked the history of this file, I can't see any particular reason why to use that approach. Probably safe to fix .

        Thank you.

        Show
        cheersyang Weiwei Yang added a comment - Hello Mingliang Liu Thank you for reviewing this, I added @VisibleForTesting like you suggested and uploaded v2 patch. Well this is an incompatible change but I think it's more like a bug fix. I checked the history of this file, I can't see any particular reason why to use that approach. Probably safe to fix . Thank you.
        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 29s trunk passed
        +1 compile 7m 29s trunk passed
        +1 checkstyle 0m 24s trunk passed
        +1 mvnsite 1m 0s trunk passed
        +1 mvneclipse 0m 14s trunk passed
        +1 findbugs 1m 31s trunk passed
        +1 javadoc 0m 47s trunk passed
        +1 mvninstall 0m 47s the patch passed
        +1 compile 7m 32s the patch passed
        +1 javac 7m 32s the patch passed
        +1 checkstyle 0m 22s the patch passed
        +1 mvnsite 0m 54s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 28s the patch passed
        +1 javadoc 0m 53s the patch passed
        +1 unit 9m 26s hadoop-common in the patch passed.
        +1 asflicense 0m 23s The patch does not generate ASF License warnings.
        42m 29s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HADOOP-13588
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827915/HADOOP-13588.002.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 696a6cb13f12 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
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / a99bf26
        Default Java 1.8.0_101
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10477/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10477/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 29s trunk passed +1 compile 7m 29s trunk passed +1 checkstyle 0m 24s trunk passed +1 mvnsite 1m 0s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 1m 31s trunk passed +1 javadoc 0m 47s trunk passed +1 mvninstall 0m 47s the patch passed +1 compile 7m 32s the patch passed +1 javac 7m 32s the patch passed +1 checkstyle 0m 22s the patch passed +1 mvnsite 0m 54s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 28s the patch passed +1 javadoc 0m 53s the patch passed +1 unit 9m 26s hadoop-common in the patch passed. +1 asflicense 0m 23s The patch does not generate ASF License warnings. 42m 29s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13588 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827915/HADOOP-13588.002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 696a6cb13f12 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / a99bf26 Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10477/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10477/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 -

        Committed to trunk branch. Thanks for contribution, Weiwei Yang.

        Show
        liuml07 Mingliang Liu added a comment - Committed to trunk branch. Thanks for contribution, Weiwei Yang .
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10428 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10428/)
        HADOOP-13588. ConfServlet should respect Accept request header. (liuml07: rev 59d59667a8b1d3fb4a744a41774b2397fd91cbb3)

        • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ConfServlet.java
        • (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfServlet.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10428 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10428/ ) HADOOP-13588 . ConfServlet should respect Accept request header. (liuml07: rev 59d59667a8b1d3fb4a744a41774b2397fd91cbb3) (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ConfServlet.java (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfServlet.java
        Hide
        cheersyang Weiwei Yang added a comment -

        Thanks a lot Mingliang Liu

        Show
        cheersyang Weiwei Yang added a comment - Thanks a lot Mingliang Liu

          People

          • Assignee:
            cheersyang Weiwei Yang
            Reporter:
            cheersyang Weiwei Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development