flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] StefanRRichter commented on a change in pull request #8125: [FLINK-10205] Batch Job: InputSplit Fault tolerant for DataSourceTask
Date Tue, 09 Apr 2019 09:44:14 GMT
StefanRRichter 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_r273390703
 
 

 ##########
 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:
   You could introduce a precondition that checks the return value of `offer` is always `true`.
Also why not use `add` like in the other cases?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message