Search in sources :

Example 1 with MockFileSystem

use of org.apache.hadoop.fs.viewfs.TestChRootedFileSystem.MockFileSystem in project hadoop by apache.

the class TestViewFileSystemDelegation method setupMockFileSystem.

private static FileSystem setupMockFileSystem(Configuration conf, URI uri) throws Exception {
    String scheme = uri.getScheme();
    conf.set("fs." + scheme + ".impl", MockFileSystem.class.getName());
    FileSystem fs = FileSystem.get(uri, conf);
    ConfigUtil.addLink(conf, "/mounts/" + scheme, uri);
    return ((MockFileSystem) fs).getRawFileSystem();
}
Also used : FileSystem(org.apache.hadoop.fs.FileSystem) MockFileSystem(org.apache.hadoop.fs.viewfs.TestChRootedFileSystem.MockFileSystem) LocalFileSystem(org.apache.hadoop.fs.LocalFileSystem) MockFileSystem(org.apache.hadoop.fs.viewfs.TestChRootedFileSystem.MockFileSystem)

Aggregations

FileSystem (org.apache.hadoop.fs.FileSystem)1 LocalFileSystem (org.apache.hadoop.fs.LocalFileSystem)1 MockFileSystem (org.apache.hadoop.fs.viewfs.TestChRootedFileSystem.MockFileSystem)1