当前位置: 首页>>代码示例>>Java>>正文


Java FileSystemTestHelper.getTestRootPath方法代码示例

本文整理汇总了Java中org.apache.hadoop.fs.FileSystemTestHelper.getTestRootPath方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemTestHelper.getTestRootPath方法的具体用法?Java FileSystemTestHelper.getTestRootPath怎么用?Java FileSystemTestHelper.getTestRootPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.fs.FileSystemTestHelper的用法示例。


在下文中一共展示了FileSystemTestHelper.getTestRootPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupForViewFileSystem

import org.apache.hadoop.fs.FileSystemTestHelper; //导入方法依赖的package包/类
/**
 * 
 * @param fsTarget - the target fs of the view fs.
 * @return return the ViewFS File context to be used for tests
 * @throws Exception
 */
static public FileSystem setupForViewFileSystem(Configuration conf, FileSystemTestHelper fileSystemTestHelper, FileSystem fsTarget) throws Exception {
  /**
   * create the test root on local_fs - the  mount table will point here
   */
  Path targetOfTests = fileSystemTestHelper.getTestRootPath(fsTarget);
  // In case previous test was killed before cleanup
  fsTarget.delete(targetOfTests, true);
  fsTarget.mkdirs(targetOfTests);


  // Set up viewfs link for test dir as described above
  String testDir = fileSystemTestHelper.getTestRootPath(fsTarget).toUri()
      .getPath();
  linkUpFirstComponents(conf, testDir, fsTarget, "test dir");
  
  
  // Set up viewfs link for home dir as described above
  setUpHomeDir(conf, fsTarget);
  
  
  // the test path may be relative to working dir - we need to make that work:
  // Set up viewfs link for wd as described above
  String wdDir = fsTarget.getWorkingDirectory().toUri().getPath();
  linkUpFirstComponents(conf, wdDir, fsTarget, "working dir");


  FileSystem fsView = FileSystem.get(FsConstants.VIEWFS_URI, conf);
  fsView.setWorkingDirectory(new Path(wdDir)); // in case testdir relative to wd.
  Log.info("Working dir is: " + fsView.getWorkingDirectory());
  return fsView;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:38,代码来源:ViewFileSystemTestSetup.java

示例2: testWDAbsolute

import org.apache.hadoop.fs.FileSystemTestHelper; //导入方法依赖的package包/类
@Test
@Ignore
@Override
public void testWDAbsolute() throws IOException {
    Path absoluteDir = FileSystemTestHelper.getTestRootPath(fSys,
            "test/existingDir");
    fSys.mkdirs(absoluteDir);
    fSys.setWorkingDirectory(absoluteDir);
    Assert.assertEquals(absoluteDir, fSys.getWorkingDirectory());
}
 
开发者ID:AsherBond,项目名称:glusterfs-hadoop,代码行数:11,代码来源:TestFSMainOperationsGlusterFileSystem.java

示例3: testWDAbsolute

import org.apache.hadoop.fs.FileSystemTestHelper; //导入方法依赖的package包/类
@Test
@Override
public void testWDAbsolute() throws IOException {
  Path absoluteDir = FileSystemTestHelper.getTestRootPath(fSys,
      "test/existingDir");
  fSys.mkdirs(absoluteDir);
  fSys.setWorkingDirectory(absoluteDir);
  Assert.assertEquals(absoluteDir, fSys.getWorkingDirectory());
}
 
开发者ID:childsb,项目名称:glusterfs-hpi,代码行数:10,代码来源:TestFSMainOperationsGlusterFileSystem.java

示例4: tearDown

import org.apache.hadoop.fs.FileSystemTestHelper; //导入方法依赖的package包/类
/**
 * 
 * delete the test directory in the target  fs
 */
static public void tearDown(FileSystemTestHelper fileSystemTestHelper, FileSystem fsTarget) throws Exception {
  Path targetOfTests = fileSystemTestHelper.getTestRootPath(fsTarget);
  fsTarget.delete(targetOfTests, true);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:ViewFileSystemTestSetup.java


注:本文中的org.apache.hadoop.fs.FileSystemTestHelper.getTestRootPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。