Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/2618#discussion_r84288975
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileReaderOperator.java
---
@@ -347,34 +328,17 @@ public void run() {
}
}
- private Tuple3<List<FileInputSplit>, FileInputSplit, S>
getReaderState() throws IOException {
- List<FileInputSplit> snapshot = new
ArrayList<>(this.pendingSplits.size());
- for (FileInputSplit split: this.pendingSplits) {
- snapshot.add(split);
- }
-
- // remove the current split from the list if inside.
- if (this.currentSplit != null &&
this.currentSplit.equals(pendingSplits.peek())) {
- this.pendingSplits.remove();
- }
-
- if (this.currentSplit != null) {
- if (this.format instanceof
CheckpointableInputFormat) {
- @SuppressWarnings("unchecked")
-
CheckpointableInputFormat<FileInputSplit, S> checkpointableFormat =
-
(CheckpointableInputFormat<FileInputSplit, S>) this.format;
-
- S formatState = this.isSplitOpen ?
-
checkpointableFormat.getCurrentState() :
- restoredFormatState;
- return new Tuple3<>(snapshot,
currentSplit, formatState);
- } else {
- LOG.info("The format does not support
checkpointing. The current input split will be re-read from start upon
recovery.");
- return new Tuple3<>(snapshot,
currentSplit, null);
+ private List<RichFileInputSplit<S>> getReaderState() throws
IOException {
+ List<RichFileInputSplit<S>> snapshot = new
ArrayList<>(this.pendingSplits.size());
+ if (currentSplit != null ) {
+ if (this.format instanceof
CheckpointableInputFormat && this.isSplitOpen) {
+ S formatState =
((CheckpointableInputFormat<RichFileInputSplit<S>, S>)
this.format).getCurrentState();
--- End diff --
```java
Serializable formatState = ((CheckpointableInputFormat)
this.format).getCurrentState();
```
---
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.
---