Hadoop Common
  1. Hadoop Common
  2. HADOOP-7032

Assert type constraints in the FileStatus constructor

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.22.0
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      A FileStatus may represent a file, directory or symlink. This is indicated using the isdir and symlink members, let's add an assert that validates the contstraints on these members (eg a directory may not have the symlink member set). We could also verify this by having more than one constructor but we don't statically know the type of the file status when we create it.

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk #514 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/514/)

        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk #514 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/514/ )
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #425 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/425/)

        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #425 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/425/ )
        Hide
        Eli Collins added a comment -

        This assert is covered by the tests now that asserts are enabled by default. I've committed this.

        Show
        Eli Collins added a comment - This assert is covered by the tests now that asserts are enabled by default. I've committed this.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12459517/hadoop-7032-1.patch
        against trunk revision 1034480.

        +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 passed contrib unit tests.

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//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/12459517/hadoop-7032-1.patch against trunk revision 1034480. +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 passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/100//console This message is automatically generated.
        Hide
        Eli Collins added a comment -

        Yes core runs with assertions enabled. Funny you mention it, I'm running HDFS-697 (enable asserts) on trunk as we speak.

        Show
        Eli Collins added a comment - Yes core runs with assertions enabled. Funny you mention it, I'm running HDFS-697 (enable asserts) on trunk as we speak.
        Hide
        Todd Lipcon added a comment -

        +1 assuming test-core ran cleanly even with assertions enabled (I don't think we've committed the -ea patch yet to HDFS, have we?)

        Show
        Todd Lipcon added a comment - +1 assuming test-core ran cleanly even with assertions enabled (I don't think we've committed the -ea patch yet to HDFS, have we?)
        Hide
        Eli Collins added a comment -

        Patch attached. test-core runs cleanly.

        Show
        Eli Collins added a comment - Patch attached. test-core runs cleanly.

          People

          • Assignee:
            Eli Collins
            Reporter:
            Eli Collins
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development