org.apache.flink.runtime.jobmaster.JobManagerSharedServices Java Examples

The following examples show how to use org.apache.flink.runtime.jobmaster.JobManagerSharedServices. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultJobMasterServiceFactory.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public DefaultJobMasterServiceFactory(
		JobMasterConfiguration jobMasterConfiguration,
		SlotPoolFactory slotPoolFactory,
		SchedulerFactory schedulerFactory,
		RpcService rpcService,
		HighAvailabilityServices haServices,
		JobManagerSharedServices jobManagerSharedServices,
		HeartbeatServices heartbeatServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) {
	this.jobMasterConfiguration = jobMasterConfiguration;
	this.slotPoolFactory = slotPoolFactory;
	this.schedulerFactory = schedulerFactory;
	this.rpcService = rpcService;
	this.haServices = haServices;
	this.jobManagerSharedServices = jobManagerSharedServices;
	this.heartbeatServices = heartbeatServices;
	this.jobManagerJobMetricGroupFactory = jobManagerJobMetricGroupFactory;
	this.fatalErrorHandler = fatalErrorHandler;
}
 
Example #2
Source File: TestingJobManagerRunnerFactory.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerSharedServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	final Supplier<Exception> exceptionSupplier = failJobMasterCreationWith.get();

	if (exceptionSupplier != null) {
		throw exceptionSupplier.get();
	} else {
		jobGraphFuture.complete(jobGraph);

		final JobManagerRunner mock = mock(JobManagerRunner.class);
		when(mock.getResultFuture()).thenReturn(resultFuture);
		when(mock.closeAsync()).thenReturn(terminationFuture);
		when(mock.getJobGraph()).thenReturn(jobGraph);

		return mock;
	}
}
 
Example #3
Source File: DispatcherTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerSharedServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	assertEquals(expectedJobId, jobGraph.getJobID());

	createdJobManagerRunnerLatch.countDown();

	return DefaultJobManagerRunnerFactory.INSTANCE.createJobManagerRunner(
		jobGraph,
		configuration,
		rpcService,
		highAvailabilityServices,
		heartbeatServices,
		jobManagerSharedServices,
		jobManagerJobMetricGroupFactory,
		fatalErrorHandler);
}
 
Example #4
Source File: DispatcherTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerSharedServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	assertEquals(expectedJobId, jobGraph.getJobID());

	createdJobManagerRunnerLatch.countDown();

	return DefaultJobManagerRunnerFactory.INSTANCE.createJobManagerRunner(
		jobGraph,
		configuration,
		rpcService,
		highAvailabilityServices,
		heartbeatServices,
		jobManagerSharedServices,
		jobManagerJobMetricGroupFactory,
		fatalErrorHandler);
}
 
Example #5
Source File: DefaultJobMasterServiceFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
public DefaultJobMasterServiceFactory(
		JobMasterConfiguration jobMasterConfiguration,
		SlotPoolFactory slotPoolFactory,
		SchedulerFactory schedulerFactory,
		RpcService rpcService,
		HighAvailabilityServices haServices,
		JobManagerSharedServices jobManagerSharedServices,
		HeartbeatServices heartbeatServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler,
		SchedulerNGFactory schedulerNGFactory,
		ShuffleMaster<?> shuffleMaster) {
	this.jobMasterConfiguration = jobMasterConfiguration;
	this.slotPoolFactory = slotPoolFactory;
	this.schedulerFactory = schedulerFactory;
	this.rpcService = rpcService;
	this.haServices = haServices;
	this.jobManagerSharedServices = jobManagerSharedServices;
	this.heartbeatServices = heartbeatServices;
	this.jobManagerJobMetricGroupFactory = jobManagerJobMetricGroupFactory;
	this.fatalErrorHandler = fatalErrorHandler;
	this.schedulerNGFactory = schedulerNGFactory;
	this.shuffleMaster = shuffleMaster;
}
 
Example #6
Source File: TestingJobManagerRunnerFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerSharedServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	final Supplier<Exception> exceptionSupplier = failJobMasterCreationWith.get();

	if (exceptionSupplier != null) {
		throw exceptionSupplier.get();
	} else {
		jobGraphFuture.complete(jobGraph);

		final JobManagerRunner mock = mock(JobManagerRunner.class);
		when(mock.getResultFuture()).thenReturn(resultFuture);
		when(mock.closeAsync()).thenReturn(terminationFuture);
		when(mock.getJobGraph()).thenReturn(jobGraph);

		return mock;
	}
}
 
Example #7
Source File: DispatcherTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerSharedServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	assertEquals(expectedJobId, jobGraph.getJobID());

	createdJobManagerRunnerLatch.countDown();

	return DefaultJobManagerRunnerFactory.INSTANCE.createJobManagerRunner(
		jobGraph,
		configuration,
		rpcService,
		highAvailabilityServices,
		heartbeatServices,
		jobManagerSharedServices,
		jobManagerJobMetricGroupFactory,
		fatalErrorHandler);
}
 
Example #8
Source File: DefaultJobMasterServiceFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
public DefaultJobMasterServiceFactory(
		JobMasterConfiguration jobMasterConfiguration,
		SlotPoolFactory slotPoolFactory,
		SchedulerFactory schedulerFactory,
		RpcService rpcService,
		HighAvailabilityServices haServices,
		JobManagerSharedServices jobManagerSharedServices,
		HeartbeatServices heartbeatServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler,
		SchedulerNGFactory schedulerNGFactory,
		ShuffleMaster<?> shuffleMaster) {
	this.jobMasterConfiguration = jobMasterConfiguration;
	this.slotPoolFactory = slotPoolFactory;
	this.schedulerFactory = schedulerFactory;
	this.rpcService = rpcService;
	this.haServices = haServices;
	this.jobManagerSharedServices = jobManagerSharedServices;
	this.heartbeatServices = heartbeatServices;
	this.jobManagerJobMetricGroupFactory = jobManagerJobMetricGroupFactory;
	this.fatalErrorHandler = fatalErrorHandler;
	this.schedulerNGFactory = schedulerNGFactory;
	this.shuffleMaster = shuffleMaster;
}
 
Example #9
Source File: JobManagerRunnerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
JobManagerRunner createJobManagerRunner(
JobGraph jobGraph,
Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
JobManagerSharedServices jobManagerServices,
JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
FatalErrorHandler fatalErrorHandler) throws Exception;
 
Example #10
Source File: JobManagerRunnerFactory.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
JobManagerRunner createJobManagerRunner(
JobGraph jobGraph,
Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
JobManagerSharedServices jobManagerServices,
JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
FatalErrorHandler fatalErrorHandler) throws Exception;
 
Example #11
Source File: JobManagerRunnerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
JobManagerRunner createJobManagerRunner(
JobGraph jobGraph,
Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
JobManagerSharedServices jobManagerServices,
JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
FatalErrorHandler fatalErrorHandler) throws Exception;
 
Example #12
Source File: Dispatcher.java    From flink with Apache License 2.0 5 votes vote down vote up
public Dispatcher(
		RpcService rpcService,
		DispatcherId fencingToken,
		DispatcherBootstrap dispatcherBootstrap,
		DispatcherServices dispatcherServices) throws Exception {
	super(rpcService, AkkaRpcServiceUtils.createRandomName(DISPATCHER_NAME), fencingToken);
	checkNotNull(dispatcherServices);

	this.configuration = dispatcherServices.getConfiguration();
	this.highAvailabilityServices = dispatcherServices.getHighAvailabilityServices();
	this.resourceManagerGatewayRetriever = dispatcherServices.getResourceManagerGatewayRetriever();
	this.heartbeatServices = dispatcherServices.getHeartbeatServices();
	this.blobServer = dispatcherServices.getBlobServer();
	this.fatalErrorHandler = dispatcherServices.getFatalErrorHandler();
	this.jobGraphWriter = dispatcherServices.getJobGraphWriter();
	this.jobManagerMetricGroup = dispatcherServices.getJobManagerMetricGroup();
	this.metricServiceQueryAddress = dispatcherServices.getMetricQueryServiceAddress();

	this.jobManagerSharedServices = JobManagerSharedServices.fromConfiguration(
		configuration,
		blobServer,
		fatalErrorHandler);

	this.runningJobsRegistry = highAvailabilityServices.getRunningJobsRegistry();

	jobManagerRunnerFutures = new HashMap<>(16);

	this.historyServerArchivist = dispatcherServices.getHistoryServerArchivist();

	this.archivedExecutionGraphStore = dispatcherServices.getArchivedExecutionGraphStore();

	this.jobManagerRunnerFactory = dispatcherServices.getJobManagerRunnerFactory();

	this.jobManagerTerminationFutures = new HashMap<>(2);

	this.shutDownFuture = new CompletableFuture<>();

	this.dispatcherBootstrap = checkNotNull(dispatcherBootstrap);
}
 
Example #13
Source File: TestingJobManagerRunnerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public TestingJobManagerRunner createJobManagerRunner(
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		JobManagerSharedServices jobManagerServices,
		JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	final TestingJobManagerRunner testingJobManagerRunner = createTestingJobManagerRunner(jobGraph);
	createdJobManagerRunner.offer(testingJobManagerRunner);

	return testingJobManagerRunner;
}
 
Example #14
Source File: DispatcherTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerSharedServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception {
	jobManagerRunnerCreationLatch.run();

	return super.createJobManagerRunner(jobGraph, configuration, rpcService, highAvailabilityServices, heartbeatServices, jobManagerSharedServices, jobManagerJobMetricGroupFactory, fatalErrorHandler);
}
 
Example #15
Source File: JobMasterBuilder.java    From flink with Apache License 2.0 4 votes vote down vote up
public JobMasterBuilder withJobManagerSharedServices(JobManagerSharedServices jobManagerSharedServices) {
	this.jobManagerSharedServices = jobManagerSharedServices;
	return this;
}
 
Example #16
Source File: DispatcherTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public TestingJobManagerRunner createJobManagerRunner(JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerSharedServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception {
	jobManagerRunnerCreationLatch.run();

	return super.createJobManagerRunner(jobGraph, configuration, rpcService, highAvailabilityServices, heartbeatServices, jobManagerSharedServices, jobManagerJobMetricGroupFactory, fatalErrorHandler);
}
 
Example #17
Source File: DispatcherResourceCleanupTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception {
	throw testException;
}
 
Example #18
Source File: Dispatcher.java    From flink with Apache License 2.0 4 votes vote down vote up
public Dispatcher(
		RpcService rpcService,
		String endpointId,
		Configuration configuration,
		HighAvailabilityServices highAvailabilityServices,
		SubmittedJobGraphStore submittedJobGraphStore,
		GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		JobManagerMetricGroup jobManagerMetricGroup,
		@Nullable String metricServiceQueryAddress,
		ArchivedExecutionGraphStore archivedExecutionGraphStore,
		JobManagerRunnerFactory jobManagerRunnerFactory,
		FatalErrorHandler fatalErrorHandler,
		HistoryServerArchivist historyServerArchivist) throws Exception {
	super(rpcService, endpointId);

	this.configuration = Preconditions.checkNotNull(configuration);
	this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices);
	this.resourceManagerGatewayRetriever = Preconditions.checkNotNull(resourceManagerGatewayRetriever);
	this.heartbeatServices = Preconditions.checkNotNull(heartbeatServices);
	this.blobServer = Preconditions.checkNotNull(blobServer);
	this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);
	this.submittedJobGraphStore = Preconditions.checkNotNull(submittedJobGraphStore);
	this.jobManagerMetricGroup = Preconditions.checkNotNull(jobManagerMetricGroup);
	this.metricServiceQueryAddress = metricServiceQueryAddress;

	this.jobManagerSharedServices = JobManagerSharedServices.fromConfiguration(
		configuration,
		this.blobServer);

	this.runningJobsRegistry = highAvailabilityServices.getRunningJobsRegistry();

	jobManagerRunnerFutures = new HashMap<>(16);

	leaderElectionService = highAvailabilityServices.getDispatcherLeaderElectionService();

	this.historyServerArchivist = Preconditions.checkNotNull(historyServerArchivist);

	this.archivedExecutionGraphStore = Preconditions.checkNotNull(archivedExecutionGraphStore);

	this.jobManagerRunnerFactory = Preconditions.checkNotNull(jobManagerRunnerFactory);

	this.jobManagerTerminationFutures = new HashMap<>(2);
}
 
Example #19
Source File: DispatcherTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public JobManagerRunner createJobManagerRunner(JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerSharedServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception {
	jobManagerRunnerCreationLatch.run();

	return super.createJobManagerRunner(jobGraph, configuration, rpcService, highAvailabilityServices, heartbeatServices, jobManagerSharedServices, jobManagerJobMetricGroupFactory, fatalErrorHandler);
}
 
Example #20
Source File: Dispatcher.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public Dispatcher(
		RpcService rpcService,
		String endpointId,
		Configuration configuration,
		HighAvailabilityServices highAvailabilityServices,
		SubmittedJobGraphStore submittedJobGraphStore,
		GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		JobManagerMetricGroup jobManagerMetricGroup,
		@Nullable String metricServiceQueryPath,
		ArchivedExecutionGraphStore archivedExecutionGraphStore,
		JobManagerRunnerFactory jobManagerRunnerFactory,
		FatalErrorHandler fatalErrorHandler,
		HistoryServerArchivist historyServerArchivist) throws Exception {
	super(rpcService, endpointId);

	this.configuration = Preconditions.checkNotNull(configuration);
	this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices);
	this.resourceManagerGatewayRetriever = Preconditions.checkNotNull(resourceManagerGatewayRetriever);
	this.heartbeatServices = Preconditions.checkNotNull(heartbeatServices);
	this.blobServer = Preconditions.checkNotNull(blobServer);
	this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);
	this.submittedJobGraphStore = Preconditions.checkNotNull(submittedJobGraphStore);
	this.jobManagerMetricGroup = Preconditions.checkNotNull(jobManagerMetricGroup);
	this.metricQueryServicePath = metricServiceQueryPath;

	this.jobManagerSharedServices = JobManagerSharedServices.fromConfiguration(
		configuration,
		this.blobServer);

	this.runningJobsRegistry = highAvailabilityServices.getRunningJobsRegistry();

	jobManagerRunnerFutures = new HashMap<>(16);

	leaderElectionService = highAvailabilityServices.getDispatcherLeaderElectionService();

	this.historyServerArchivist = Preconditions.checkNotNull(historyServerArchivist);

	this.archivedExecutionGraphStore = Preconditions.checkNotNull(archivedExecutionGraphStore);

	this.jobManagerRunnerFactory = Preconditions.checkNotNull(jobManagerRunnerFactory);

	this.jobManagerTerminationFutures = new HashMap<>(2);
}