@Test(timeout = 10000)
public void buildListingForSingleFile() throws Exception {
FileSystem fs = cluster.getFileSystem();
String testRootString = "/tmp/source";
Path testRoot = new Path(testRootString);
if (fs.exists(testRoot)) {
delete(fs, testRootString);
}
Path sourceFile = new Path(testRoot, "foo/bar/source.txt");
Path decoyFile = new Path(testRoot, "target/mooc");
URI targetFile = URI.create("s3://bucket/target/moo/target.txt");
createFile(fs, sourceFile.toString());
createFile(fs, decoyFile.toString());
final Path listFile = new Path(testRoot, "/tmp/fileList.seq");
listing.buildListing(listFile, options(sourceFile, targetFile));
try (SequenceFile.Reader reader = new SequenceFile.Reader(CONFIG, SequenceFile.Reader.file(listFile))) {
CopyListingFileStatus fileStatus = new CopyListingFileStatus();
Text relativePath = new Text();
assertThat(reader.next(relativePath, fileStatus), is(true));
assertThat(relativePath.toString(), is("/source.txt"));
}
}
SimpleCopyListingTest.java 文件源码
java
阅读 16
收藏 0
点赞 0
评论 0
项目:circus-train
作者:
评论列表
文章目录