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

The exception meessage in FileUtil$HardLink.getLinkCount(..) is not clear

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When a file is not found, FileUtil$HardLink.getLinkCount(..) shows the following error message.

      java.lang.NumberFormatException: For input string: ""
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      	at java.lang.Integer.parseInt(Integer.java:470)
      	at java.lang.Integer.parseInt(Integer.java:499)
      	at org.apache.hadoop.fs.FileUtil$HardLink.getLinkCount(FileUtil.java:663)
      	at org.apache.hadoop.hdfs.server.datanode.ReplicaInfo.detachBlock(ReplicaInfo.java:209)
      	...
      stat: cannot stat `/home/tsz/hadoop/hdfs/h265/build/test/data/dfs/data/data3/current/finalized/blk_-94418387820168072_1001.meta':
       No such file or directory on file:/home/tsz/hadoop/hdfs/h265/build/test/data/dfs/data/data3/current/finalized/blk_-94418387820168072_1001.meta
      

      It looks like that there was a uncaught NumberFormatException.

      1. c6283_20090923.patch
        0.6 kB
        Tsz Wo Nicholas Sze
      2. c6283_20091007.patch
        3 kB
        Tsz Wo Nicholas Sze

        Activity

        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        c6283_20090923.patch: throws FileNotFoundException if the file does not exist.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - c6283_20090923.patch: throws FileNotFoundException if the file does not exist.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        c6283_20091007.patch: also changed the exception messages.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - c6283_20091007.patch: also changed the exception messages.
        Hide
        dhruba dhruba borthakur added a comment -

        +1. Code looks good.

        Show
        dhruba dhruba borthakur added a comment - +1. Code looks good.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        Thanks, Dhruba for the review.

        No new tests will be added for this since it only changes exception messages.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - Thanks, Dhruba for the review. No new tests will be added for this since it only changes exception messages.
        Hide
        hadoopqa Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12421555/c6283_20091007.patch
        against trunk revision 822805.

        +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.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12421555/c6283_20091007.patch against trunk revision 822805. +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. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/75/console This message is automatically generated.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        I have committed this.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - I have committed this.
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #55 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk-Commit/55/)
        . Improve the exception messages thrown by FileUtil$HardLink.getLinkCount(..).

        Show
        hudson Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #55 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk-Commit/55/ ) . Improve the exception messages thrown by FileUtil$HardLink.getLinkCount(..).
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-Common-trunk #122 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk/122/)
        . Improve the exception messages thrown by FileUtil$HardLink.getLinkCount(..).

        Show
        hudson Hudson added a comment - Integrated in Hadoop-Common-trunk #122 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk/122/ ) . Improve the exception messages thrown by FileUtil$HardLink.getLinkCount(..).

          People

          • Assignee:
            szetszwo Tsz Wo Nicholas Sze
            Reporter:
            szetszwo Tsz Wo Nicholas Sze
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development