use of org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig in project flink by apache.
the class FileWriterTest method testPreCommit.
@Test
public void testPreCommit() throws Exception {
File outDir = TEMP_FOLDER.newFolder();
Path path = new Path(outDir.toURI());
FileWriter<String> fileWriter = createWriter(path, OnCheckpointRollingPolicy.build(), new OutputFileConfig("part-", ""));
fileWriter.write("test1", new ContextImpl());
fileWriter.write("test1", new ContextImpl());
fileWriter.write("test2", new ContextImpl());
fileWriter.write("test2", new ContextImpl());
fileWriter.write("test3", new ContextImpl());
Collection<FileSinkCommittable> committables = fileWriter.prepareCommit();
assertEquals(3, committables.size());
}
Aggregations