Java 类org.apache.hadoop.fs.viewfs.ChRootedFileSystem 实例源码

项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testCreateSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.createSnapshot(snapRootPath, "snap1");
  verify(mockFs).createSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testDeleteSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.deleteSnapshot(snapRootPath, "snap1");
  verify(mockFs).deleteSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testRenameSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.renameSnapshot(snapRootPath, "snapOldName", "snapNewName");
  verify(mockFs).renameSnapshot(chRootedSnapRootPath, "snapOldName",
      "snapNewName");
}
项目:hadoop    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testCreateSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.createSnapshot(snapRootPath, "snap1");
  verify(mockFs).createSnapshot(chRootedSnapRootPath, "snap1");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testDeleteSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.deleteSnapshot(snapRootPath, "snap1");
  verify(mockFs).deleteSnapshot(chRootedSnapRootPath, "snap1");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Test(timeout = 30000)
public void testRenameSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path("/a/b/snapPath");

  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem) chrootFs.getRawFileSystem())
      .getRawFileSystem();

  chrootFs.renameSnapshot(snapRootPath, "snapOldName", "snapNewName");
  verify(mockFs).renameSnapshot(chRootedSnapRootPath, "snapOldName",
      "snapNewName");
}
项目:big-c    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:big-c    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-plus    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop-plus    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hops    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hops    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-TCP    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop-TCP    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hardfs    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hardfs    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-on-lustre2    文件:TestChRootedFileSystem.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  Configuration conf = new Configuration();
  fSysTarget = FileSystem.getLocal(conf);
  fileSystemTestHelper = new FileSystemTestHelper();
  chrootedTo = fileSystemTestHelper.getAbsoluteTestRootPath(fSysTarget);
  // In case previous test was killed before cleanup
  fSysTarget.delete(chrootedTo, true);

  fSysTarget.mkdirs(chrootedTo);


  // ChRoot to the root of the testDirectory
  fSys = new ChRootedFileSystem(chrootedTo.toUri(), conf);
}
项目:hadoop-on-lustre2    文件:TestChRootedFileSystem.java   
@Test
public void testDeleteOnExitPathHandling() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  // ensure delete propagates the correct path
  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  chrootFs.delete(chrootPath, false);
  verify(mockFs).delete(eq(rawPath), eq(false));
  reset(mockFs);

  // fake that the path exists for deleteOnExit
  FileStatus stat = mock(FileStatus.class);
  when(mockFs.getFileStatus(eq(rawPath))).thenReturn(stat);
  // ensure deleteOnExit propagates the correct path
  chrootFs.deleteOnExit(chrootPath);
  chrootFs.close();
  verify(mockFs).delete(eq(rawPath), eq(true));
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:hadoop-oss    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:hadoop    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:hadoop    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:big-c    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:big-c    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:hadoop-plus    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:hops    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}
项目:hops    文件:TestChRootedFileSystem.java   
/**
 * Tests that ChRootedFileSystem delegates calls for every ACL method to the
 * underlying FileSystem with all Path arguments translated as required to
 * enforce chroot.
 */
@Test
public void testAclMethodsPathTranslation() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo/a/b");
  ChRootedFileSystem chrootFs = new ChRootedFileSystem(chrootUri, conf);
  FileSystem mockFs = ((FilterFileSystem)chrootFs.getRawFileSystem())
      .getRawFileSystem();

  Path chrootPath = new Path("/c");
  Path rawPath = new Path("/a/b/c");
  List<AclEntry> entries = Collections.emptyList();

  chrootFs.modifyAclEntries(chrootPath, entries);
  verify(mockFs).modifyAclEntries(rawPath, entries);

  chrootFs.removeAclEntries(chrootPath, entries);
  verify(mockFs).removeAclEntries(rawPath, entries);

  chrootFs.removeDefaultAcl(chrootPath);
  verify(mockFs).removeDefaultAcl(rawPath);

  chrootFs.removeAcl(chrootPath);
  verify(mockFs).removeAcl(rawPath);

  chrootFs.setAcl(chrootPath, entries);
  verify(mockFs).setAcl(rawPath, entries);

  chrootFs.getAclStatus(chrootPath);
  verify(mockFs).getAclStatus(rawPath);
}
项目:hadoop-TCP    文件:TestChRootedFileSystem.java   
@Test
public void testURIEmptyPath() throws IOException {
  Configuration conf = new Configuration();
  conf.setClass("fs.mockfs.impl", MockFileSystem.class, FileSystem.class);

  URI chrootUri = URI.create("mockfs://foo");
  new ChRootedFileSystem(chrootUri, conf);
}