use of org.apache.flink.connector.file.src.impl.StreamFormatAdapter in project flink by apache.
the class LimitableBulkFormatTest method testSwallowExceptionWhenLimited.
@Test
public void testSwallowExceptionWhenLimited() throws IOException {
long limit = 1000L;
LimitableBulkFormat<String, FileSourceSplit> format = (LimitableBulkFormat<String, FileSourceSplit>) LimitableBulkFormat.create(new StreamFormatAdapter<>(new FailedFormat()), limit);
BulkFormat.Reader<String> reader = format.createReader(new Configuration(), new FileSourceSplit("id", new Path(file.toURI()), 0, file.length()));
format.globalNumberRead().set(limit + 1);
// should swallow exception
reader.readBatch();
}
Aggregations