Search in sources :

Example 11 with ChRootedFileSystem

use of org.apache.hadoop.fs.viewfs.ChRootedFileSystem in project hadoop by apache.

the class TestChRootedFileSystem method setUp.

@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);
}
Also used : FileSystemTestHelper(org.apache.hadoop.fs.FileSystemTestHelper) Configuration(org.apache.hadoop.conf.Configuration) ChRootedFileSystem(org.apache.hadoop.fs.viewfs.ChRootedFileSystem) Before(org.junit.Before)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)11 ChRootedFileSystem (org.apache.hadoop.fs.viewfs.ChRootedFileSystem)11 URI (java.net.URI)10 Test (org.junit.Test)10 FileSystem (org.apache.hadoop.fs.FileSystem)9 FilterFileSystem (org.apache.hadoop.fs.FilterFileSystem)9 Path (org.apache.hadoop.fs.Path)8 FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystemTestHelper (org.apache.hadoop.fs.FileSystemTestHelper)1 AclEntry (org.apache.hadoop.fs.permission.AclEntry)1 Before (org.junit.Before)1