Hadoop Common
  1. Hadoop Common
  2. HADOOP-6283

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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_20091007.patch
        3 kB
        Tsz Wo Nicholas Sze
      2. c6283_20090923.patch
        0.6 kB
        Tsz Wo Nicholas Sze

        Activity

        Tsz Wo Nicholas Sze created issue -
        Tsz Wo Nicholas Sze made changes -
        Field Original Value New Value
        Summary FileUtil$HardLink.getLinkCount(..) throws NumberFormatException The exception meessage in FileUtil$HardLink.getLinkCount(..) is not clear
        Description {noformat}
        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)
        ...
        {noformat}
        When a file is not found, FileUtil$HardLink.getLinkCount(..) shows the following error message.
        {noformat}
        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
        {noformat}
        It looks like that there was a uncaught NumberFormatException.
        Tsz Wo Nicholas Sze made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Description When a file is not found, FileUtil$HardLink.getLinkCount(..) shows the following error message.
        {noformat}
        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
        {noformat}
        It looks like that there was a uncaught NumberFormatException.
        When a file is not found, FileUtil$HardLink.getLinkCount(..) shows the following error message.
        {noformat}
        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
        {noformat}
        It looks like that there was a uncaught NumberFormatException.
        Hide
        Tsz Wo Nicholas Sze added a comment -

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

        Show
        Tsz Wo Nicholas Sze added a comment - c6283_20090923.patch: throws FileNotFoundException if the file does not exist.
        Tsz Wo Nicholas Sze made changes -
        Attachment c6283_20090923.patch [ 12420415 ]
        Tsz Wo Nicholas Sze made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Tsz Wo Nicholas Sze added a comment -

        c6283_20091007.patch: also changed the exception messages.

        Show
        Tsz Wo Nicholas Sze added a comment - c6283_20091007.patch: also changed the exception messages.
        Tsz Wo Nicholas Sze made changes -
        Attachment c6283_20091007.patch [ 12421555 ]
        Hide
        dhruba borthakur added a comment -

        +1. Code looks good.

        Show
        dhruba borthakur added a comment - +1. Code looks good.
        Hide
        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
        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.
        Tsz Wo Nicholas Sze made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Tsz Wo Nicholas Sze made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hadoop Flags [Reviewed]
        Assignee Tsz Wo (Nicholas), SZE [ szetszwo ]
        Hide
        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
        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
        Tsz Wo Nicholas Sze added a comment -

        I have committed this.

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this.
        Tsz Wo Nicholas Sze made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 0.22.0 [ 12314296 ]
        Resolution Fixed [ 1 ]
        Hide
        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 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 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 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(..).
        Tom White made changes -
        Fix Version/s 0.21.0 [ 12313563 ]
        Fix Version/s 0.22.0 [ 12314296 ]
        Tom White made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Patch Available Patch Available Open Open
        14d 19h 26m 1 Tsz Wo Nicholas Sze 08/Oct/09 19:00
        Open Open Patch Available Patch Available
        39m 1s 2 Tsz Wo Nicholas Sze 08/Oct/09 19:00
        Patch Available Patch Available Resolved Resolved
        37m 16s 1 Tsz Wo Nicholas Sze 08/Oct/09 19:38
        Resolved Resolved Closed Closed
        320d 2h 2m 1 Tom White 24/Aug/10 21:40

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development