Search in sources :

Example 1 with TestingJobResultStore

use of org.apache.flink.runtime.testutils.TestingJobResultStore in project flink by apache.

the class JobDispatcherLeaderProcessFactoryFactoryTest method createDispatcherLeaderProcessFactoryFromTestInstance.

private static JobDispatcherLeaderProcessFactory createDispatcherLeaderProcessFactoryFromTestInstance(@Nullable JobGraph jobGraph, @Nullable JobResult dirtyJobResult, Path storageDir) throws IOException {
    final JobDispatcherLeaderProcessFactoryFactory testInstance = new JobDispatcherLeaderProcessFactoryFactory(ignoredConfig -> jobGraph);
    final TestingJobResultStore jobResultStore = TestingJobResultStore.builder().withGetDirtyResultsSupplier(() -> CollectionUtil.ofNullable(dirtyJobResult)).build();
    final JobGraphStore jobGraphStore = new StandaloneJobGraphStore();
    return testInstance.createFactory(new TestingJobPersistenceComponentFactory(jobGraphStore, jobResultStore), Executors.directExecutor(), new TestingRpcService(), TestingPartialDispatcherServices.builder().withHighAvailabilityServices(new TestingHighAvailabilityServicesBuilder().setJobGraphStore(jobGraphStore).setJobResultStore(jobResultStore).build()).build(storageDir.toFile(), new Configuration()), NoOpFatalErrorHandler.INSTANCE);
}
Also used : StandaloneJobGraphStore(org.apache.flink.runtime.jobmanager.StandaloneJobGraphStore) Configuration(org.apache.flink.configuration.Configuration) StandaloneJobGraphStore(org.apache.flink.runtime.jobmanager.StandaloneJobGraphStore) JobGraphStore(org.apache.flink.runtime.jobmanager.JobGraphStore) TestingRpcService(org.apache.flink.runtime.rpc.TestingRpcService) TestingJobPersistenceComponentFactory(org.apache.flink.runtime.jobmanager.TestingJobPersistenceComponentFactory) TestingJobResultStore(org.apache.flink.runtime.testutils.TestingJobResultStore) TestingHighAvailabilityServicesBuilder(org.apache.flink.runtime.highavailability.TestingHighAvailabilityServicesBuilder)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)1 TestingHighAvailabilityServicesBuilder (org.apache.flink.runtime.highavailability.TestingHighAvailabilityServicesBuilder)1 JobGraphStore (org.apache.flink.runtime.jobmanager.JobGraphStore)1 StandaloneJobGraphStore (org.apache.flink.runtime.jobmanager.StandaloneJobGraphStore)1 TestingJobPersistenceComponentFactory (org.apache.flink.runtime.jobmanager.TestingJobPersistenceComponentFactory)1 TestingRpcService (org.apache.flink.runtime.rpc.TestingRpcService)1 TestingJobResultStore (org.apache.flink.runtime.testutils.TestingJobResultStore)1