zhuzhurk commented on code in PR #20299:
URL: https://github.com/apache/flink/pull/20299#discussion_r925447573
##########
flink-runtime/src/main/java/org/apache/flink/runtime/source/coordinator/SourceCoordinatorContext.java:
##########
@@ -431,4 +489,125 @@ private <V> V callInCoordinatorThread(Callable<V>
callable, String errorMessage)
throw new FlinkRuntimeException(errorMessage, t);
}
}
+
+ private void assignSplitsToAttempts(SplitsAssignment<SplitT> assignment) {
+ assignment.assignment().forEach((index, splits) ->
assignSplitsToAttempts(index, splits));
+ }
+
+ private void assignSplitsToAttempts(int subtaskIndex, List<SplitT> splits)
{
+ getRegisteredAttempts(subtaskIndex)
+ .forEach(attempt -> assignSplitsToAttempt(subtaskIndex,
attempt, splits));
+ }
+
+ private void assignSplitsToAttempt(int subtaskIndex, int attemptNumber,
List<SplitT> splits) {
+ checkAttemptReaderReady(subtaskIndex, attemptNumber);
+
+ final AddSplitEvent<SplitT> addSplitEvent;
+ try {
+ addSplitEvent = new AddSplitEvent<>(splits, splitSerializer);
Review Comment:
fixed. Note that the `splits` is not possible to be null (checked before) so
we only check if it is empty.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]