XComp commented on a change in pull request #18189:
URL: https://github.com/apache/flink/pull/18189#discussion_r791720372
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/JobDispatcherFactory.java
##########
@@ -38,13 +40,21 @@ public MiniDispatcher createDispatcher(
RpcService rpcService,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
+ Collection<JobResult> recoveredDirtyJobResults,
DispatcherBootstrapFactory dispatcherBootstrapFactory,
- PartialDispatcherServicesWithJobGraphStore
partialDispatcherServicesWithJobGraphStore)
+ PartialDispatcherServicesWithJobPersistenceComponents
+ partialDispatcherServicesWithJobPersistenceComponents)
throws Exception {
- final JobGraph jobGraph = Iterables.getOnlyElement(recoveredJobs);
+ final Optional<JobGraph> recoveredJobGraph =
CollectionUtil.atMostOnce(recoveredJobs);
+ final Optional<JobResult> recoveredDirtyJob =
+ CollectionUtil.atMostOnce(recoveredDirtyJobResults);
+
+ Preconditions.checkArgument(
+ recoveredJobGraph.isPresent() != recoveredDirtyJob.isPresent(),
+ "Either the JobGraph or the recovered JobResult needs to be
specified.");
Review comment:
Oh, interesting. That one I overlooked. Thanks 👍
--
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]