Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1185

Remove duplicate now() functions in DataNode, FSNamesystem

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.1
    • Fix Version/s: 0.22.0
    • Component/s: datanode, namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      An identical now() function is defined in Util, DataNode, and FSNamesystem. This patch removes the latter two and converts all calls to use the Util.now function.

        Activity

        Hide
        Konstantin Shvachko added a comment -

        Sounds like a good idea. One nit. It would be nice to use import static, like this

        import static org.apache.hadoop.hdfs.server.common.Util.now;
        

        Then direct calls to now() in FDNamesystem and DataNode will remain unchanged. In other places it will just say now.

        Show
        Konstantin Shvachko added a comment - Sounds like a good idea. One nit. It would be nice to use import static, like this import static org.apache.hadoop.hdfs.server.common.Util.now; Then direct calls to now() in FDNamesystem and DataNode will remain unchanged. In other places it will just say now .
        Hide
        Jakob Homan added a comment -

        Konstantin just beat me to the static import suggestion. I've added you to the HDFS contributors so you should be able to use submit patch to trigger Hudson's automated test patch; this also lets reviewers know the patch ready for review. Thanks for the contributions.

        Show
        Jakob Homan added a comment - Konstantin just beat me to the static import suggestion. I've added you to the HDFS contributors so you should be able to use submit patch to trigger Hudson's automated test patch; this also lets reviewers know the patch ready for review. Thanks for the contributions.
        Hide
        Jeff Ames added a comment -

        New version of patch that uses "import static org.apache.hadoop.hdfs.server.common.Util.now".

        Show
        Jeff Ames added a comment - New version of patch that uses "import static org.apache.hadoop.hdfs.server.common.Util.now".
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12446323/HDFS-1185-2.patch
        against trunk revision 951178.

        +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 findbugs. The patch does not introduce any new Findbugs warnings.

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

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

        -1 contrib tests. The patch failed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/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/12446323/HDFS-1185-2.patch against trunk revision 951178. +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 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/394/console This message is automatically generated.
        Hide
        Jakob Homan added a comment -

        +1. Existing tests cover this refactor. Failed contrib test is unrelated.

        Show
        Jakob Homan added a comment - +1. Existing tests cover this refactor. Failed contrib test is unrelated.
        Hide
        Jakob Homan added a comment -

        I've just committed this. Thanks Jeff! Resolving as fixed.

        Show
        Jakob Homan added a comment - I've just committed this. Thanks Jeff! Resolving as fixed.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #298 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/298/)

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #298 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/298/ )

          People

          • Assignee:
            Jeff Ames
            Reporter:
            Jeff Ames
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development