类org.apache.hadoop.fs.TestTrash源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.TestTrash的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hadoop   文件: TestHDFSTrash.java

@Test
public void testNonDefaultFS() throws IOException {
  FileSystem fs = cluster.getFileSystem();
  Configuration conf = fs.getConf();
  conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, fs.getUri().toString());
  TestTrash.trashNonDefaultFS(conf);
}
 
源代码2 项目: big-c   文件: TestHDFSTrash.java

@Test
public void testNonDefaultFS() throws IOException {
  FileSystem fs = cluster.getFileSystem();
  Configuration conf = fs.getConf();
  conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, fs.getUri().toString());
  TestTrash.trashNonDefaultFS(conf);
}
 
源代码3 项目: RDFS   文件: TestFileDeleteWhitelist.java

public void testFileDeleteWithTrash() throws IOException {
  Configuration conf = new Configuration();
  conf.set("fs.trash.interval", "10"); // 10 minute

  // create cluster
  MiniDFSCluster cluster = new MiniDFSCluster(conf, 1, true, null);
  FileSystem fs = null;
  try {
    cluster.waitActive();
    fs = cluster.getFileSystem();

    // create file1.
    Path dir = new Path("/foo");
    Path file1 = new Path(dir, "file1");
    createFile(fs, file1);
    System.out.println("testFileCreationDeleteParent: "
        + "Created file " + file1);
    fs.delete(file1, true);

    // create file2.
    Path file2 = new Path("/tmp", "file2");
    createFile(fs, file2);
    System.out.println("testFileCreationDeleteParent: "
        + "Created file " + file2);
    fs.delete(file2, true);

    TrashPolicy trashPolicy = TrashPolicy.getInstance(conf, fs, fs.getHomeDirectory());
    Path trashRoot = trashPolicy.getCurrentTrashDir();
    TestTrash.checkTrash(fs, trashRoot, file1);
    TestTrash.checkNotInTrash(fs, trashRoot, file2.toString());
  } finally {
    fs.close();
    cluster.shutdown();
  }
}
 
源代码4 项目: hadoop   文件: TestHDFSTrash.java

@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
 
源代码5 项目: hadoop   文件: TestViewFsTrash.java

@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
 
源代码6 项目: big-c   文件: TestHDFSTrash.java

@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
 
源代码7 项目: big-c   文件: TestViewFsTrash.java

@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
 
 类所在包
 类方法
 同包方法