Ryantaocer commented on a change in pull request #8125: [FLINK-10205] Batch
Job: InputSplit Fault tolerant for DataSourceTask
URL: https://github.com/apache/flink/pull/8125#discussion_r273427466
##########
File path:
flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/distcp/FileCopyTaskInputFormat.java
##########
@@ -62,6 +62,15 @@ public InputSplit getNextInputSplit(String host, int
taskId) {
LOGGER.info("Getting copy task for task: " + taskId);
return splits.poll();
}
+
+ @Override
+ public void returnInputSplit(List<InputSplit> splits, int
taskId) {
+ synchronized (this.splits) {
+ for (InputSplit split : splits) {
+
this.splits.offer((FileCopyTaskInputSplit) split);
Review comment:
Sure, the returned `split` should be the one obtained via
`getNextInputSplit`. Precondition check has been added. And using `add` is ok
for `Queue` here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services