use of org.apache.flink.runtime.jobmanager.JobGraphWriter in project flink by apache.
the class ApplicationDispatcherGatewayServiceFactory method create.
@Override
public AbstractDispatcherLeaderProcess.DispatcherGatewayService create(DispatcherId fencingToken, Collection<JobGraph> recoveredJobs, Collection<JobResult> recoveredDirtyJobResults, JobGraphWriter jobGraphWriter, JobResultStore jobResultStore) {
final List<JobID> recoveredJobIds = getRecoveredJobIds(recoveredJobs);
final Dispatcher dispatcher;
try {
dispatcher = dispatcherFactory.createDispatcher(rpcService, fencingToken, recoveredJobs, recoveredDirtyJobResults, (dispatcherGateway, scheduledExecutor, errorHandler) -> new ApplicationDispatcherBootstrap(application, recoveredJobIds, configuration, dispatcherGateway, scheduledExecutor, errorHandler), PartialDispatcherServicesWithJobPersistenceComponents.from(partialDispatcherServices, jobGraphWriter, jobResultStore));
} catch (Exception e) {
throw new FlinkRuntimeException("Could not create the Dispatcher rpc endpoint.", e);
}
dispatcher.start();
return DefaultDispatcherGatewayService.from(dispatcher);
}
use of org.apache.flink.runtime.jobmanager.JobGraphWriter in project flink by apache.
the class DefaultDispatcherGatewayServiceFactory method create.
@Override
public AbstractDispatcherLeaderProcess.DispatcherGatewayService create(DispatcherId fencingToken, Collection<JobGraph> recoveredJobs, Collection<JobResult> recoveredDirtyJobResults, JobGraphWriter jobGraphWriter, JobResultStore jobResultStore) {
final Dispatcher dispatcher;
try {
dispatcher = dispatcherFactory.createDispatcher(rpcService, fencingToken, recoveredJobs, recoveredDirtyJobResults, (dispatcherGateway, scheduledExecutor, errorHandler) -> new NoOpDispatcherBootstrap(), PartialDispatcherServicesWithJobPersistenceComponents.from(partialDispatcherServices, jobGraphWriter, jobResultStore));
} catch (Exception e) {
throw new FlinkRuntimeException("Could not create the Dispatcher rpc endpoint.", e);
}
dispatcher.start();
return DefaultDispatcherGatewayService.from(dispatcher);
}
use of org.apache.flink.runtime.jobmanager.JobGraphWriter in project flink by apache.
the class DispatcherResourceCleanerFactoryTest method createJobGraphWriter.
private JobGraphWriter createJobGraphWriter() throws Exception {
jobGraphWriterLocalCleanupFuture = new CompletableFuture<>();
jobGraphWriterGlobalCleanupFuture = new CompletableFuture<>();
final TestingJobGraphStore jobGraphStore = TestingJobGraphStore.newBuilder().setGlobalCleanupFunction((jobId, executor) -> {
jobGraphWriterGlobalCleanupFuture.complete(jobId);
return FutureUtils.completedVoidFuture();
}).setLocalCleanupFunction((jobId, ignoredExecutor) -> {
jobGraphWriterLocalCleanupFuture.complete(jobId);
return FutureUtils.completedVoidFuture();
}).build();
jobGraphStore.start(null);
return jobGraphStore;
}
Aggregations