Package org.apache.hadoop.hdfs

Examples of org.apache.hadoop.hdfs.DistributedRaidFileSystem.rename()


      }
     
      raidFs.mkdirs(destHarPath);
      raidFs.mkdirs(new Path(destHarPath, "rename" + RaidNode.HAR_SUFFIX));
     
      raidFs.rename(new Path("/user/dikang/raidtest"),
          new Path("/user/dikang/raidtest1"));
      fail("Expected fail for HAR rename");
    } catch (IOException ie) {
      String message = ie.getMessage();
      assertTrue(message.contains("HAR dir"));
View Full Code Here


      parity = ParityFilePair.getParityFile(Codec.getCodec("xor"),
          destPath,
          conf);
      assertNull(parity);
      // do the rename file
      assertTrue(raidFs.rename(srcPath, destPath));
      // verify the results.
      assertFalse(raidFs.exists(srcPath));
      assertTrue(raidFs.exists(destPath));
      assertFalse(raidFs.exists(srcParityPath));
      parity = ParityFilePair.getParityFile(Codec.getCodec("xor"),
View Full Code Here

          conf);
      assertTrue(raidFs.exists(parity.getPath()));
     
      // rename the dir
      assertFalse(raidFs.exists(destDirPath));
      assertTrue(raidFs.rename(srcPath2.getParent(), destDirPath));
      // verify the results.
      assertFalse(raidFs.exists(srcPath2.getParent()));
      assertTrue(raidFs.exists(destDirPath));
     
      parity = ParityFilePair.getParityFile(Codec.getCodec("xor"),
View Full Code Here

      }
     
      raidFs.mkdirs(destHarPath);
      raidFs.mkdirs(new Path(destHarPath, "rename" + RaidNode.HAR_SUFFIX));
     
      raidFs.rename(new Path("/user/dikang/raidtest"),
          new Path("/user/dikang/raidtest1"));
      fail("Expected fail for HAR rename");
    } catch (IOException ie) {
      String message = ie.getMessage();
      assertTrue(message.contains("HAR dir"));
View Full Code Here

      Path srcParityPath = parity.getPath();
      assertTrue(raidFs.exists(srcParityPath));
      assertFalse(raidFs.exists(destPath));
     
      // do the rename file
      assertTrue(raidFs.rename(srcPath, destPath));
      // verify the results.
      assertFalse(raidFs.exists(srcPath));
      assertTrue(raidFs.exists(destPath));
      assertFalse(raidFs.exists(srcParityPath));
      FileStatus srcDest = fileSys.getFileStatus(destPath);
View Full Code Here

          conf);
      assertTrue(raidFs.exists(parity.getPath()));
     
      // rename the dir
      assertFalse(raidFs.exists(destDirPath));
      assertTrue(raidFs.rename(srcPath2.getParent(), destDirPath));
      // verify the results.
      assertFalse(raidFs.exists(srcPath2.getParent()));
      assertTrue(raidFs.exists(destDirPath));
      FileStatus srcDest2 = fileSys.getFileStatus(destPath2);
      parity = ParityFilePair.getParityFile(Codec.getCodec("xor"),
View Full Code Here

      assertTrue(raidFs.exists(parity.getPath()));
     
      // try to rename not existed file.
      Path notExistedPath = new Path("/user/dhruba/raidtest/raidnotexist");
      Path notExistedPath2 = new Path("/user/dhruba/raidtest/raidnotexist2");
      assertFalse(raidFs.rename(notExistedPath, notExistedPath2));
    } finally {
      stopCluster();
    }
  }
 
View Full Code Here

      // verify we did not delete the parityPath
      assertFalse(raidFs.exists(srcPath));
      assertTrue(raidFs.exists(srcParityPath));
     
      // test rename file
      raidFs.rename(srcPath2, new Path("/tmp/raidtest/rename/f3"));
      // verify we did not rename the parityPath
      assertFalse(raidFs.exists(srcPath2));
      assertTrue(raidFs.exists(srcParityPath2));
    } finally {
      stopCluster();
View Full Code Here

      Path srcParityPath2 = parity2.getPath();
      assertTrue(raidFs.exists(srcParityPath));
      assertTrue(raidFs.exists(srcParityPath2));
     
      // test rename files
      raidFs.rename(srcPath, new Path("/ignore1/test/rename/f2"));
      raidFs.rename(srcPath2, new Path("/ignore2/test/rename/f2"));
      // verify we did not rename the parityPath
      assertFalse(raidFs.exists(srcPath));
      assertTrue(raidFs.exists(srcParityPath));
      assertFalse(raidFs.exists(srcPath2));
View Full Code Here

      assertTrue(raidFs.exists(srcParityPath));
      assertTrue(raidFs.exists(srcParityPath2));
     
      // test rename files
      raidFs.rename(srcPath, new Path("/ignore1/test/rename/f2"));
      raidFs.rename(srcPath2, new Path("/ignore2/test/rename/f2"));
      // verify we did not rename the parityPath
      assertFalse(raidFs.exists(srcPath));
      assertTrue(raidFs.exists(srcParityPath));
      assertFalse(raidFs.exists(srcPath2));
      assertTrue(raidFs.exists(srcParityPath2));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.