Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/2618#discussion_r84280372
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileReaderOperator.java
---
@@ -199,44 +196,39 @@ public void close() throws Exception {
private final Object checkpointLock;
private final SourceFunction.SourceContext<OT> readerContext;
- private final Queue<FileInputSplit> pendingSplits;
-
- private FileInputSplit currentSplit = null;
+ private final Queue<RichFileInputSplit<S>> pendingSplits;
- private S restoredFormatState = null;
+ private RichFileInputSplit<S> currentSplit;
- private volatile boolean isSplitOpen = false;
+ private volatile boolean isSplitOpen;
private SplitReader(FileInputFormat<OT> format,
TypeSerializer<OT> serializer,
SourceFunction.SourceContext<OT>
readerContext,
Object checkpointLock,
- Tuple3<List<FileInputSplit>,
FileInputSplit, S> restoredState) {
+ List<RichFileInputSplit<S>>
restoredState) {
this.format = checkNotNull(format, "Unspecified
FileInputFormat.");
this.serializer = checkNotNull(serializer, "Unspecified
Serializer.");
this.readerContext = checkNotNull(readerContext,
"Unspecified Reader Context.");
this.checkpointLock = checkNotNull(checkpointLock,
"Unspecified checkpoint lock.");
- this.pendingSplits = new ArrayDeque<>();
this.isRunning = true;
- // this is the case where a task recovers from a
previous failed attempt
- if (restoredState != null) {
- List<FileInputSplit> pending = restoredState.f0;
- FileInputSplit current = restoredState.f1;
- S formatState = restoredState.f2;
-
- for (FileInputSplit split : pending) {
- pendingSplits.add(split);
+ this.pendingSplits = new PriorityQueue<>(100, new
Comparator<RichFileInputSplit<S>>() {
--- End diff --
Why did you choose 100 as the initial size?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---