Hadoop Common
  1. Hadoop Common
  2. HADOOP-8244

Improve comments on ByteBufferReadable.read

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2-alpha
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      There are a couple of ways in which the comment on ByteBufferReadable.read can be improved. Since this is a public-facing API with potentially many implementations, it's worth taking the time to get it right.

      • We should describe what can become of the byte buffer state in the case of an exception (is the limit changed? where's the position?). For the DFSInputStream implementation, position and limit are unchanged if there is an error, but I don't think that's the right think to mandate for all implementations.
      • We should mention explicitly that 0-byte reads are legitimate - this is particularly important in light of HDFS-3110 which detects support for direct reads by issuing a 0-byte read from libhdfs.
      1. HADOOP-8244.0.patch
        2 kB
        Henry Robinson
      2. HADOOP-8244.1.patch
        2 kB
        Henry Robinson

        Activity

        Henry Robinson created issue -
        Hide
        Henry Robinson added a comment -

        Patch against trunk. No tests included, because it's a doc update.

        Show
        Henry Robinson added a comment - Patch against trunk. No tests included, because it's a doc update.
        Henry Robinson made changes -
        Field Original Value New Value
        Attachment HADOOP-8244.0.patch [ 12521203 ]
        Henry Robinson made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

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

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

        -1 tests included. 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 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 eclipse:eclipse. The patch built with eclipse:eclipse.

        +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 unit tests:
        org.apache.hadoop.fs.viewfs.TestViewFsTrash

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/816//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/816//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/12521203/HADOOP-8244.0.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. 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 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 eclipse:eclipse. The patch built with eclipse:eclipse. +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 unit tests: org.apache.hadoop.fs.viewfs.TestViewFsTrash +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/816//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/816//console This message is automatically generated.
        Hide
        Henry Robinson added a comment -

        I'm going to go out on a limb and say the test failure is not as a result of this patch

        Show
        Henry Robinson added a comment - I'm going to go out on a limb and say the test failure is not as a result of this patch
        Hide
        Aaron T. Myers added a comment -

        Patch looks pretty good to me, Henry. One little comment:

        1. "After the call, buf.position() and buf.limit() should be unchanged..." - perhaps change this to "after a successful call" ?
        Show
        Aaron T. Myers added a comment - Patch looks pretty good to me, Henry. One little comment: "After the call, buf.position() and buf.limit() should be unchanged..." - perhaps change this to "after a successful call" ?
        Hide
        Henry Robinson added a comment -

        Seems reasonable - patch includes Aaron's suggested rewording.

        Show
        Henry Robinson added a comment - Seems reasonable - patch includes Aaron's suggested rewording.
        Henry Robinson made changes -
        Attachment HADOOP-8244.1.patch [ 12521416 ]
        Hide
        Aaron T. Myers added a comment -

        +1, the patch looks good to me. I'm going to commit this momentarily.

        Show
        Aaron T. Myers added a comment - +1, the patch looks good to me. I'm going to commit this momentarily.
        Hide
        Aaron T. Myers added a comment -

        I've just committed this to trunk. Thanks a lot for the contribution, Hank.

        Show
        Aaron T. Myers added a comment - I've just committed this to trunk. Thanks a lot for the contribution, Hank.
        Aaron T. Myers made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Target Version/s 0.24.0 [ 12317652 ]
        Fix Version/s 0.24.0 [ 12317652 ]
        Resolution Fixed [ 1 ]
        Hide
        Hadoop QA added a comment -

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

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

        -1 tests included. 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 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 eclipse:eclipse. The patch built with eclipse:eclipse.

        +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 unit tests:
        org.apache.hadoop.fs.viewfs.TestViewFsTrash

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/821//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/821//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/12521416/HADOOP-8244.1.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. 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 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 eclipse:eclipse. The patch built with eclipse:eclipse. +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 unit tests: org.apache.hadoop.fs.viewfs.TestViewFsTrash +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/821//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/821//console This message is automatically generated.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2011 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2011/)
        HADOOP-8244. Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2011 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2011/ ) HADOOP-8244 . Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2074 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2074/)
        HADOOP-8244. Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2074 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2074/ ) HADOOP-8244 . Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #1999 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1999/)
        HADOOP-8244. Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #1999 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1999/ ) HADOOP-8244 . Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1006 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1006/)
        HADOOP-8244. Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625)

        Result = FAILURE
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1006 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1006/ ) HADOOP-8244 . Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625) Result = FAILURE atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1041 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1041/)
        HADOOP-8244. Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1041 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1041/ ) HADOOP-8244 . Improve comments on ByteBufferReadable.read. Contributed by Henry Robinson. (Revision 1309625) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1309625 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ByteBufferReadable.java
        Hide
        Todd Lipcon added a comment -

        Committed to branch-2 as well.

        Show
        Todd Lipcon added a comment - Committed to branch-2 as well.
        Todd Lipcon made changes -
        Target Version/s 0.24.0 [ 12317652 ] 2.0.1-alpha [ 12321441 ]
        Todd Lipcon made changes -
        Fix Version/s 2.0.1-alpha [ 12321441 ]
        Fix Version/s 0.24.0 [ 12317652 ]
        Arun C Murthy made changes -
        Fix Version/s 2.0.2-alpha [ 12322473 ]
        Fix Version/s 2.1.0-alpha [ 12321441 ]
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        20m 25s 1 Henry Robinson 03/Apr/12 21:18
        Patch Available Patch Available Resolved Resolved
        1d 3h 18m 1 Aaron T. Myers 05/Apr/12 00:36
        Resolved Resolved Closed Closed
        189d 18h 8m 1 Arun C Murthy 11/Oct/12 18:45

          People

          • Assignee:
            Henry Robinson
            Reporter:
            Henry Robinson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development