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

项目: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);
}
项目:aliyun-oss-hadoop-fs    文件: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);
}
项目: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);
}
项目:hadoop-2.6.0-cdh5.4.3    文件: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);
}
项目:hadoop-EAR    文件: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();
  }
}
项目:hadoop-plus    文件: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);
}
项目:FlexMap    文件: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);
}
项目:hops    文件: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);
}
项目:hadoop-TCP    文件: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);
}
项目:hardfs    文件: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);
}
项目:hadoop-on-lustre2    文件: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);
}
项目: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();
  }
}
项目:hadoop-oss    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hadoop    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hadoop    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:aliyun-oss-hadoop-fs    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:aliyun-oss-hadoop-fs    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:big-c    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:big-c    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hadoop-plus    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hadoop-plus    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:FlexMap    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hops    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hops    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hadoop-TCP    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hadoop-TCP    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hardfs    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hardfs    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}
项目:hadoop-on-lustre2    文件:TestHDFSTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(cluster.getFileSystem(), new Path("/"));
}
项目:hadoop-on-lustre2    文件:TestViewFsTrash.java   
@Test
public void testTrash() throws IOException {
  TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
      fsTarget, new Path(fsTarget.getHomeDirectory(), ".Trash/Current"));
}