Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-590

When trying to rename a non-existent path, LocalFileSystem throws an FileNotFoundException, while HDFS returns false

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None

      Description

      HDFS should also throw FileNotFoundException instead of returning false.

      1. HDFS-590.1.patch
        5 kB
        Jitendra Nath Pandey

        Issue Links

          Activity

          Hide
          Jitendra Nath Pandey added a comment -

          This issue is handled as part of HADOOP-6240.

          Show
          Jitendra Nath Pandey added a comment - This issue is handled as part of HADOOP-6240 .
          Hide
          Tom White added a comment -

          This looks good, except you don't need to add a new test, but merely change the rename call in FileSystemContractBaseTest.testRenameNonExistentPath() to

              try {
                fs.rename(src, dst);
                fail("Should throw FileNotFoundException.");
              } catch (FileNotFoundException e) {
                // Expected
              }
          
          Show
          Tom White added a comment - This looks good, except you don't need to add a new test, but merely change the rename call in FileSystemContractBaseTest.testRenameNonExistentPath() to try { fs.rename(src, dst); fail( "Should throw FileNotFoundException." ); } catch (FileNotFoundException e) { // Expected }

            People

            • Assignee:
              Jitendra Nath Pandey
              Reporter:
              Jitendra Nath Pandey
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development