private static Path createDataFile() throws IOException {
File txtFile = File.createTempFile("test-", "." + FILE_EXTENSION);
try (FileWriter writer = new FileWriter(txtFile)) {
IntStream.range(0, NUM_RECORDS).forEach(index -> {
String value = String.format("%d_%s", index, UUID.randomUUID());
try {
writer.append(value + "\n");
OFFSETS_BY_INDEX.put(index, Long.valueOf(index++));
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
});
}
Path path = new Path(new Path(fsUri), txtFile.getName());
fs.moveFromLocalFile(new Path(txtFile.getAbsolutePath()), path);
return path;
}
TextFileReaderTest.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:kafka-connect-fs
作者:
评论列表
文章目录