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

Annotate NameNode and DataNode MXBean interfaces as Private/Stable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None
    • Release Note:
      The DataNode and NameNode MXBean interfaces have been marked as Private and Stable to indicate that although users should not be implementing these interfaces directly, the information exposed by these interfaces is part of the HDFS public API.

      Description

      NameNodeMXBean, NameNodeStatusMXBean, DataNodeMXBean are annotated @Public and @Stable, but some methods are being added. For example, DataNodeMXBean.getBPServiceActorInfo was added between branch-2.7.3 and branch-2.8. Adding methods to interfaces breaks the user classes which implement them, so we should make them @Private.

      1. HDFS-11217_00.patch
        3 kB
        Jagadesh Kiran N

        Activity

        Hide
        anu Anu Engineer added a comment -

        Adding methods to interfaces breaks the user classes which implement them, so we should make them @Private

        Wouldn't making them private a bigger violation of the contract ? I agree it might not break the end user application, but they might not even realize that we have changed the suggested access method.

        Unfortunately, I don't have a better suggestion than yourself on how to fix this issue.

        Show
        anu Anu Engineer added a comment - Adding methods to interfaces breaks the user classes which implement them, so we should make them @Private Wouldn't making them private a bigger violation of the contract ? I agree it might not break the end user application, but they might not even realize that we have changed the suggested access method. Unfortunately, I don't have a better suggestion than yourself on how to fix this issue.
        Hide
        andrew.wang Andrew Wang added a comment -

        I think the rationale is that end users shouldn't be implementing these interfaces, and instead access this information through the JMX APIs. The JMX APIs are public and stable, not these Java interfaces.

        So, I think something like "private/stable" is the correct designation, with a comment explaining the above. I think it's unlikely that any external code is implementing these interfaces.

        Show
        andrew.wang Andrew Wang added a comment - I think the rationale is that end users shouldn't be implementing these interfaces, and instead access this information through the JMX APIs. The JMX APIs are public and stable, not these Java interfaces. So, I think something like "private/stable" is the correct designation, with a comment explaining the above. I think it's unlikely that any external code is implementing these interfaces.
        Hide
        anu Anu Engineer added a comment -

        Andrew Wang Thanks for the explanation. Makes sense. But the original JIRA mentions

        Adding methods to interfaces breaks the user classes which implement them

        But I agree that user classes should not be implementing them. I am okay with making these private.

        Show
        anu Anu Engineer added a comment - Andrew Wang Thanks for the explanation. Makes sense. But the original JIRA mentions Adding methods to interfaces breaks the user classes which implement them But I agree that user classes should not be implementing them. I am okay with making these private.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        So, I think something like "private/stable" is the correct designation, with a comment explaining the above. I think it's unlikely that any external code is implementing these interfaces.

        Agreed. Thanks Andrew Wang and Anu Engineer.

        Show
        ajisakaa Akira Ajisaka added a comment - So, I think something like "private/stable" is the correct designation, with a comment explaining the above. I think it's unlikely that any external code is implementing these interfaces. Agreed. Thanks Andrew Wang and Anu Engineer .
        Hide
        jagadesh.kiran Jagadesh Kiran N added a comment -

        Attached the patch, please review

        Show
        jagadesh.kiran Jagadesh Kiran N added a comment - Attached the patch, please review
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 13s 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 57s trunk passed
        +1 compile 0m 47s trunk passed
        +1 checkstyle 0m 27s trunk passed
        +1 mvnsite 0m 54s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 42s trunk passed
        +1 javadoc 0m 38s trunk passed
        +1 mvninstall 0m 47s the patch passed
        +1 compile 0m 43s the patch passed
        +1 javac 0m 43s the patch passed
        +1 checkstyle 0m 24s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 63 unchanged - 3 fixed = 63 total (was 66)
        +1 mvnsite 0m 50s the patch passed
        +1 mvneclipse 0m 10s the patch passed
        -1 whitespace 0m 0s The patch has 2 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
        +1 findbugs 1m 47s the patch passed
        +1 javadoc 0m 35s the patch passed
        +1 unit 67m 54s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 22s The patch does not generate ASF License warnings.
        87m 40s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HDFS-11217
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12842561/HDFS-11217_00.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 1a3a12441c48 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 80b8023
        Default Java 1.8.0_111
        findbugs v3.0.0
        whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/17808/artifact/patchprocess/whitespace-eol.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/17808/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/17808/console
        Powered by Apache Yetus 0.5.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 13s 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 57s trunk passed +1 compile 0m 47s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 54s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 42s trunk passed +1 javadoc 0m 38s trunk passed +1 mvninstall 0m 47s the patch passed +1 compile 0m 43s the patch passed +1 javac 0m 43s the patch passed +1 checkstyle 0m 24s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 63 unchanged - 3 fixed = 63 total (was 66) +1 mvnsite 0m 50s the patch passed +1 mvneclipse 0m 10s the patch passed -1 whitespace 0m 0s The patch has 2 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply +1 findbugs 1m 47s the patch passed +1 javadoc 0m 35s the patch passed +1 unit 67m 54s hadoop-hdfs in the patch passed. +1 asflicense 0m 22s The patch does not generate ASF License warnings. 87m 40s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11217 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12842561/HDFS-11217_00.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 1a3a12441c48 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 80b8023 Default Java 1.8.0_111 findbugs v3.0.0 whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/17808/artifact/patchprocess/whitespace-eol.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/17808/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/17808/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        andrew.wang Andrew Wang added a comment -

        +1 LGTM, I'll fix the whitespace on commit.

        Show
        andrew.wang Andrew Wang added a comment - +1 LGTM, I'll fix the whitespace on commit.
        Hide
        andrew.wang Andrew Wang added a comment -

        Committed to trunk, branch-2, branch-2.8. Thanks for the contribution Jagadesh, and discussion Akira and Anu!

        Show
        andrew.wang Andrew Wang added a comment - Committed to trunk, branch-2, branch-2.8. Thanks for the contribution Jagadesh, and discussion Akira and Anu!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10977 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10977/)
        HDFS-11217. Annotate NameNode and DataNode MXBean interfaces as (wang: rev 5bd7dece920b20da95755cf7fbba9b3f39c7da69)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeStatusMXBean.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10977 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10977/ ) HDFS-11217 . Annotate NameNode and DataNode MXBean interfaces as (wang: rev 5bd7dece920b20da95755cf7fbba9b3f39c7da69) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeStatusMXBean.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNodeMXBean.java
        Hide
        jagadesh.kiran Jagadesh Kiran N added a comment -

        Thanks Andrew Wang for commiting the same ,and Akira & Anu for discussion

        Show
        jagadesh.kiran Jagadesh Kiran N added a comment - Thanks Andrew Wang for commiting the same ,and Akira & Anu for discussion

          People

          • Assignee:
            jagadesh.kiran Jagadesh Kiran N
            Reporter:
            ajisakaa Akira Ajisaka
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development