本文整理汇总了Java中org.apache.hadoop.fs.viewfs.ChRootedFileSystem类的典型用法代码示例。如果您正苦于以下问题:Java ChRootedFileSystem类的具体用法?Java ChRootedFileSystem怎么用?Java ChRootedFileSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChRootedFileSystem类属于org.apache.hadoop.fs.viewfs包,在下文中一共展示了ChRootedFileSystem类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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);
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:TestChRootedFileSystem.java
示例2: testDeleteOnExitPathHandling
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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));
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:26,代码来源:TestChRootedFileSystem.java
示例3: testCreateSnapshot
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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");
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:TestChRootedFileSystem.java
示例4: testDeleteSnapshot
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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");
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:TestChRootedFileSystem.java
示例5: testRenameSnapshot
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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");
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:18,代码来源:TestChRootedFileSystem.java
示例6: testURIEmptyPath
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
@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);
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:TestChRootedFileSystem.java
示例7: testAclMethodsPathTranslation
import org.apache.hadoop.fs.viewfs.ChRootedFileSystem; //导入依赖的package包/类
/**
* 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);
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:38,代码来源:TestChRootedFileSystem.java
注:本文中的org.apache.hadoop.fs.viewfs.ChRootedFileSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论