• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TestDistCpUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.tools.util.TestDistCpUtils的典型用法代码示例。如果您正苦于以下问题:Java TestDistCpUtils类的具体用法?Java TestDistCpUtils怎么用?Java TestDistCpUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestDistCpUtils类属于org.apache.hadoop.tools.util包,在下文中一共展示了TestDistCpUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDuplicates

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test(timeout=10000)
public void testDuplicates() {
  FileSystem fs = null;
  try {
    fs = FileSystem.get(getConf());
    List<Path> srcPaths = new ArrayList<Path>();
    srcPaths.add(new Path("/tmp/in/*/*"));
    TestDistCpUtils.createFile(fs, "/tmp/in/src1/1.txt");
    TestDistCpUtils.createFile(fs, "/tmp/in/src2/1.txt");
    Path target = new Path("/tmp/out");
    Path listingFile = new Path("/tmp/list");
    DistCpOptions options = new DistCpOptions(srcPaths, target);
    CopyListing listing = CopyListing.getCopyListing(getConf(), CREDENTIALS, options);
    try {
      listing.buildListing(listingFile, options);
      Assert.fail("Duplicates not detected");
    } catch (DuplicateFileException ignore) {
    }
  } catch (IOException e) {
    LOG.error("Exception encountered in test", e);
    Assert.fail("Test failed " + e.getMessage());
  } finally {
    TestDistCpUtils.delete(fs, "/tmp");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:TestCopyListing.java


示例2: setup

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@BeforeClass
public static void setup() throws URISyntaxException{
  try {
    Path fswd = FileSystem.get(getConf()).getWorkingDirectory();
    Configuration vConf = ViewFileSystemTestSetup.createConfig(false); 
    ConfigUtil.addLink(vConf, "/usr", new URI(fswd.toString())); 
    fs = FileSystem.get(FsConstants.VIEWFS_URI, vConf);
    fs.setWorkingDirectory(new Path("/usr"));
    listFile = new Path("target/tmp/listing").makeQualified(fs.getUri(),
            fs.getWorkingDirectory());
    target = new Path("target/tmp/target").makeQualified(fs.getUri(),
            fs.getWorkingDirectory()); 
    root = new Path("target/tmp").makeQualified(fs.getUri(),
            fs.getWorkingDirectory()).toString();
    TestDistCpUtils.delete(fs, root);
  } catch (IOException e) {
    LOG.error("Exception encountered ", e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestDistCpViewFs.java


示例3: caseSingleFileMissingTarget

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleFileMissingTarget(boolean sync) {

    try {
      addEntries(listFile, "singlefile1/file1");
      createFiles("singlefile1/file1");

      runTest(listFile, target, false, sync);

      checkResult(target, 1);
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestDistCpViewFs.java


示例4: caseSingleFileTargetFile

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleFileTargetFile(boolean sync) {

    try {
      addEntries(listFile, "singlefile1/file1");
      createFiles("singlefile1/file1", target.toString());

      runTest(listFile, target, false, sync);

      checkResult(target, 1);
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestDistCpViewFs.java


示例5: caseSingleFileTargetDir

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleFileTargetDir(boolean sync) {

    try {
      addEntries(listFile, "singlefile2/file2");
      createFiles("singlefile2/file2");
      mkdirs(target.toString());

      runTest(listFile, target, true, sync);

      checkResult(target, 1, "file2");
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestDistCpViewFs.java


示例6: caseSingleDirTargetMissing

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleDirTargetMissing(boolean sync) {

    try {
      addEntries(listFile, "singledir");
      mkdirs(root + "/singledir/dir1");

      runTest(listFile, target, false, sync);

      checkResult(target, 1, "dir1");
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestDistCpViewFs.java


示例7: testSingleDirTargetPresent

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testSingleDirTargetPresent() {

  try {
    addEntries(listFile, "singledir");
    mkdirs(root + "/singledir/dir1");
    mkdirs(target.toString());

    runTest(listFile, target, true, false);

    checkResult(target, 1, "singledir/dir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestDistCpViewFs.java


示例8: testUpdateSingleDirTargetPresent

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testUpdateSingleDirTargetPresent() {

  try {
    addEntries(listFile, "Usingledir");
    mkdirs(root + "/Usingledir/Udir1");
    mkdirs(target.toString());

    runTest(listFile, target, true, true);

    checkResult(target, 1, "Udir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestDistCpViewFs.java


示例9: caseMultiFileTargetPresent

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseMultiFileTargetPresent(boolean sync) {

    try {
      addEntries(listFile, "multifile/file3", "multifile/file4", "multifile/file5");
      createFiles("multifile/file3", "multifile/file4", "multifile/file5");
      mkdirs(target.toString());

      runTest(listFile, target, true, sync);

      checkResult(target, 3, "file3", "file4", "file5");
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestDistCpViewFs.java


示例10: caseMultiFileTargetMissing

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseMultiFileTargetMissing(boolean sync) {

    try {
      addEntries(listFile, "multifile/file3", "multifile/file4", "multifile/file5");
      createFiles("multifile/file3", "multifile/file4", "multifile/file5");

      runTest(listFile, target, false, sync);

      checkResult(target, 3, "file3", "file4", "file5");
    } catch (IOException e) {
      LOG.error("Exception encountered while testing distcp", e);
      Assert.fail("distcp failure");
    } finally {
      TestDistCpUtils.delete(fs, root);
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestDistCpViewFs.java


示例11: testMultiDirTargetPresent

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testMultiDirTargetPresent() {

  try {
    addEntries(listFile, "multifile", "singledir");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    mkdirs(target.toString(), root + "/singledir/dir1");

    runTest(listFile, target, true, false);

    checkResult(target, 2, "multifile/file3", "multifile/file4", "multifile/file5", "singledir/dir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestDistCpViewFs.java


示例12: testUpdateMultiDirTargetPresent

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testUpdateMultiDirTargetPresent() {

  try {
    addEntries(listFile, "Umultifile", "Usingledir");
    createFiles("Umultifile/Ufile3", "Umultifile/Ufile4", "Umultifile/Ufile5");
    mkdirs(target.toString(), root + "/Usingledir/Udir1");

    runTest(listFile, target, true, true);

    checkResult(target, 4, "Ufile3", "Ufile4", "Ufile5", "Udir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestDistCpViewFs.java


示例13: testMultiDirTargetMissing

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testMultiDirTargetMissing() {

  try {
    addEntries(listFile, "multifile", "singledir");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    mkdirs(root + "/singledir/dir1");

    runTest(listFile, target, false, false);

    checkResult(target, 2, "multifile/file3", "multifile/file4",
        "multifile/file5", "singledir/dir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestDistCpViewFs.java


示例14: testUpdateMultiDirTargetMissing

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testUpdateMultiDirTargetMissing() {

  try {
    addEntries(listFile, "multifile", "singledir");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    mkdirs(root + "/singledir/dir1");

    runTest(listFile, target, false, true);

    checkResult(target, 4, "file3", "file4", "file5", "dir1");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestDistCpViewFs.java


示例15: testGlobTargetMissingSingleLevel

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testGlobTargetMissingSingleLevel() {

  try {
    Path listFile = new Path("target/tmp1/listing").makeQualified(fs.getUri(),
                              fs.getWorkingDirectory());
    addEntries(listFile, "*");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    createFiles("singledir/dir2/file6");

    runTest(listFile, target, false, false);

    checkResult(target, 2, "multifile/file3", "multifile/file4", "multifile/file5",
        "singledir/dir2/file6");
  } catch (IOException e) {
    LOG.error("Exception encountered while testing distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
    TestDistCpUtils.delete(fs, "target/tmp1");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestDistCpViewFs.java


示例16: testUpdateGlobTargetMissingSingleLevel

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testUpdateGlobTargetMissingSingleLevel() {

  try {
    Path listFile = new Path("target/tmp1/listing").makeQualified(fs.getUri(),
                                fs.getWorkingDirectory());
    addEntries(listFile, "*");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    createFiles("singledir/dir2/file6");

    runTest(listFile, target, false, true);

    checkResult(target, 4, "file3", "file4", "file5", "dir2/file6");
  } catch (IOException e) {
    LOG.error("Exception encountered while running distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
    TestDistCpUtils.delete(fs, "target/tmp1");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestDistCpViewFs.java


示例17: testGlobTargetMissingMultiLevel

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testGlobTargetMissingMultiLevel() {

  try {
    Path listFile = new Path("target/tmp1/listing").makeQualified(fs.getUri(),
            fs.getWorkingDirectory());
    addEntries(listFile, "*/*");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    createFiles("singledir1/dir3/file7", "singledir1/dir3/file8",
        "singledir1/dir3/file9");

    runTest(listFile, target, false, false);

    checkResult(target, 4, "file3", "file4", "file5",
        "dir3/file7", "dir3/file8", "dir3/file9");
  } catch (IOException e) {
    LOG.error("Exception encountered while running distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
    TestDistCpUtils.delete(fs, "target/tmp1");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestDistCpViewFs.java


示例18: testUpdateGlobTargetMissingMultiLevel

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
@Test
public void testUpdateGlobTargetMissingMultiLevel() {

  try {
    Path listFile = new Path("target/tmp1/listing").makeQualified(fs.getUri(),
            fs.getWorkingDirectory());
    addEntries(listFile, "*/*");
    createFiles("multifile/file3", "multifile/file4", "multifile/file5");
    createFiles("singledir1/dir3/file7", "singledir1/dir3/file8",
        "singledir1/dir3/file9");

    runTest(listFile, target, false, true);

    checkResult(target, 6, "file3", "file4", "file5",
        "file7", "file8", "file9");
  } catch (IOException e) {
    LOG.error("Exception encountered while running distcp", e);
    Assert.fail("distcp failure");
  } finally {
    TestDistCpUtils.delete(fs, root);
    TestDistCpUtils.delete(fs, "target/tmp1");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestDistCpViewFs.java


示例19: caseSingleFileMissingTarget

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleFileMissingTarget(boolean sync) {

    try {
      Path listFile = new Path("/tmp/listing");
      Path target = new Path("/tmp/target");

      addEntries(listFile, "/tmp/singlefile1/file1");
      createFiles("/tmp/singlefile1/file1");

      runTest(listFile, target, false, sync);

      checkResult(listFile, 0);
    } catch (IOException e) {
      LOG.error("Exception encountered while testing build listing", e);
      Assert.fail("build listing failure");
    } finally {
      TestDistCpUtils.delete(fs, "/tmp");
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestFileBasedCopyListing.java


示例20: caseSingleFileTargetFile

import org.apache.hadoop.tools.util.TestDistCpUtils; //导入依赖的package包/类
private void caseSingleFileTargetFile(boolean sync) {

    try {
      Path listFile = new Path("/tmp/listing");
      Path target = new Path("/tmp/target");

      addEntries(listFile, "/tmp/singlefile1/file1");
      createFiles("/tmp/singlefile1/file1", target.toString());

      runTest(listFile, target, false, sync);

      checkResult(listFile, 0);
    } catch (IOException e) {
      LOG.error("Exception encountered while testing build listing", e);
      Assert.fail("build listing failure");
    } finally {
      TestDistCpUtils.delete(fs, "/tmp");
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestFileBasedCopyListing.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseAnimationInterface类代码示例发布时间:2022-05-22
下一篇:
Java Instrumentation类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap