Java Code Examples for org.apache.flink.runtime.rpc.RpcService

The following examples show how to use org.apache.flink.runtime.rpc.RpcService. These examples are extracted from open source projects. 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 Project: flink   Source File: MiniCluster.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull
private CompletionStage<Void> terminateRpcServices() {
	synchronized (lock) {
		final int numRpcServices = 1 + rpcServices.size();

		final Collection<CompletableFuture<?>> rpcTerminationFutures = new ArrayList<>(numRpcServices);

		rpcTerminationFutures.add(commonRpcService.stopService());

		for (RpcService rpcService : rpcServices) {
			rpcTerminationFutures.add(rpcService.stopService());
		}

		commonRpcService = null;
		rpcServices.clear();

		return FutureUtils.completeAll(rpcTerminationFutures);
	}
}
 
Example 2
Source Project: flink   Source File: TestingResourceManager.java    License: Apache License 2.0 6 votes vote down vote up
public TestingResourceManager(
		RpcService rpcService,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		ResourceManagerPartitionTrackerFactory clusterPartitionTrackerFactory,
		JobLeaderIdService jobLeaderIdService,
		FatalErrorHandler fatalErrorHandler,
		ResourceManagerMetricGroup resourceManagerMetricGroup) {
	super(
		rpcService,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		clusterPartitionTrackerFactory,
		jobLeaderIdService,
		new ClusterInformation("localhost", 1234),
		fatalErrorHandler,
		resourceManagerMetricGroup,
		RpcUtils.INF_TIMEOUT);
}
 
Example 3
Source Project: flink   Source File: TestingTaskExecutor.java    License: Apache License 2.0 6 votes vote down vote up
public TestingTaskExecutor(
		RpcService rpcService,
		TaskManagerConfiguration taskManagerConfiguration,
		HighAvailabilityServices haServices,
		TaskManagerServices taskExecutorServices,
		HeartbeatServices heartbeatServices,
		TaskManagerMetricGroup taskManagerMetricGroup,
		@Nullable String metricQueryServiceAddress,
		BlobCacheService blobCacheService,
		FatalErrorHandler fatalErrorHandler,
		PartitionTable<JobID> partitionTable) {
	super(
		rpcService,
		taskManagerConfiguration,
		haServices,
		taskExecutorServices,
		heartbeatServices,
		taskManagerMetricGroup,
		metricQueryServiceAddress,
		blobCacheService,
		fatalErrorHandler,
		partitionTable);
}
 
Example 4
Source Project: flink   Source File: TaskManagerRunner.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Create a RPC service for the task manager.
 *
 * @param configuration The configuration for the TaskManager.
 * @param haServices to use for the task manager hostname retrieval
 */
@VisibleForTesting
static RpcService createRpcService(
	final Configuration configuration,
	final HighAvailabilityServices haServices) throws Exception {

	checkNotNull(configuration);
	checkNotNull(haServices);

	return AkkaRpcServiceUtils.createRemoteRpcService(
		configuration,
		determineTaskManagerBindAddress(configuration, haServices),
		configuration.getString(TaskManagerOptions.RPC_PORT),
		configuration.getString(TaskManagerOptions.BIND_HOST),
		configuration.getOptional(TaskManagerOptions.RPC_BIND_PORT));
}
 
Example 5
public TaskExecutorToResourceManagerConnection(
		Logger log,
		RpcService rpcService,
		String taskManagerAddress,
		ResourceID taskManagerResourceId,
		RetryingRegistrationConfiguration retryingRegistrationConfiguration,
		int dataPort,
		HardwareDescription hardwareDescription,
		String resourceManagerAddress,
		ResourceManagerId resourceManagerId,
		Executor executor,
		RegistrationConnectionListener<TaskExecutorToResourceManagerConnection, TaskExecutorRegistrationSuccess> registrationListener) {

	super(log, resourceManagerAddress, resourceManagerId, executor);

	this.rpcService = checkNotNull(rpcService);
	this.taskManagerAddress = checkNotNull(taskManagerAddress);
	this.taskManagerResourceId = checkNotNull(taskManagerResourceId);
	this.retryingRegistrationConfiguration = checkNotNull(retryingRegistrationConfiguration);
	this.dataPort = dataPort;
	this.hardwareDescription = checkNotNull(hardwareDescription);
	this.registrationListener = checkNotNull(registrationListener);
}
 
Example 6
Source Project: flink   Source File: ActiveResourceManagerFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected ResourceManager<ResourceID> createActiveResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		JobManagerMetricGroup jobManagerMetricGroup) {
	assertThat(configuration.contains(TaskManagerOptions.MANAGED_MEMORY_SIZE), is(true));

	return null;
}
 
Example 7
Source Project: flink   Source File: MiniCluster.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Factory method to instantiate the RPC service.
 *
 * @param akkaRpcServiceConfig
 *            The default RPC timeout for asynchronous "ask" requests.
 * @param remoteEnabled
 *            True, if the RPC service should be reachable from other (remote) RPC services.
 * @param bindAddress
 *            The address to bind the RPC service to. Only relevant when "remoteEnabled" is true.
 *
 * @return The instantiated RPC service
 */
protected RpcService createRpcService(
		AkkaRpcServiceConfiguration akkaRpcServiceConfig,
		boolean remoteEnabled,
		String bindAddress) {

	final Config akkaConfig;

	if (remoteEnabled) {
		akkaConfig = AkkaUtils.getAkkaConfig(akkaRpcServiceConfig.getConfiguration(), bindAddress, 0);
	} else {
		akkaConfig = AkkaUtils.getAkkaConfig(akkaRpcServiceConfig.getConfiguration());
	}

	final Config effectiveAkkaConfig = AkkaUtils.testDispatcherConfig().withFallback(akkaConfig);

	final ActorSystem actorSystem = AkkaUtils.createActorSystem(effectiveAkkaConfig);

	return new AkkaRpcService(actorSystem, akkaRpcServiceConfig);
}
 
Example 8
Source Project: Flink-CEPplus   Source File: StandaloneResourceManager.java    License: Apache License 2.0 6 votes vote down vote up
public StandaloneResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		jobManagerMetricGroup);
}
 
Example 9
Source Project: flink   Source File: RetryingRegistration.java    License: Apache License 2.0 6 votes vote down vote up
public RetryingRegistration(
		Logger log,
		RpcService rpcService,
		String targetName,
		Class<G> targetType,
		String targetAddress,
		F fencingToken,
		RetryingRegistrationConfiguration retryingRegistrationConfiguration) {

	this.log = checkNotNull(log);
	this.rpcService = checkNotNull(rpcService);
	this.targetName = checkNotNull(targetName);
	this.targetType = checkNotNull(targetType);
	this.targetAddress = checkNotNull(targetAddress);
	this.fencingToken = checkNotNull(fencingToken);
	this.retryingRegistrationConfiguration = checkNotNull(retryingRegistrationConfiguration);

	this.completionFuture = new CompletableFuture<>();
}
 
Example 10
Source Project: Flink-CEPplus   Source File: AkkaRpcActorTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Tests that actors are properly terminated when the AkkaRpcService is shut down.
 */
@Test
public void testActorTerminationWhenServiceShutdown() throws Exception {
	final ActorSystem rpcActorSystem = AkkaUtils.createDefaultActorSystem();
	final RpcService rpcService = new AkkaRpcService(
		rpcActorSystem, AkkaRpcServiceConfiguration.defaultConfiguration());

	try {
		SimpleRpcEndpoint rpcEndpoint = new SimpleRpcEndpoint(rpcService, SimpleRpcEndpoint.class.getSimpleName());

		rpcEndpoint.start();

		CompletableFuture<Void> terminationFuture = rpcEndpoint.getTerminationFuture();

		rpcService.stopService();

		terminationFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
	} finally {
		rpcActorSystem.terminate();
		Await.ready(rpcActorSystem.whenTerminated(), FutureUtils.toFiniteDuration(timeout));
	}
}
 
Example 11
Source Project: flink   Source File: JobLeaderService.java    License: Apache License 2.0 6 votes vote down vote up
JobManagerRetryingRegistration(
		Logger log,
		RpcService rpcService,
		String targetName,
		Class<JobMasterGateway> targetType,
		String targetAddress,
		JobMasterId jobMasterId,
		RetryingRegistrationConfiguration retryingRegistrationConfiguration,
		String taskManagerRpcAddress,
		TaskManagerLocation taskManagerLocation) {
	super(
		log,
		rpcService,
		targetName,
		targetType,
		targetAddress,
		jobMasterId,
		retryingRegistrationConfiguration);

	this.taskManagerRpcAddress = taskManagerRpcAddress;
	this.taskManagerLocation = Preconditions.checkNotNull(taskManagerLocation);
}
 
Example 12
Source Project: flink   Source File: TestingJobManagerRunnerFactory.java    License: 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 13
Source Project: flink   Source File: TaskManagerRunnerStartupTest.java    License: Apache License 2.0 6 votes vote down vote up
private static void startTaskManager(
	Configuration configuration,
	RpcService rpcService,
	HighAvailabilityServices highAvailabilityServices
) throws Exception {

	TaskManagerRunner.startTaskManager(
		configuration,
		ResourceID.generate(),
		rpcService,
		highAvailabilityServices,
		new TestingHeartbeatServices(),
		NoOpMetricRegistry.INSTANCE,
		new BlobCacheService(
			configuration,
			new VoidBlobStore(),
			null),
		false,
		ExternalResourceInfoProvider.NO_EXTERNAL_RESOURCES,
		error -> {});
}
 
Example 14
Source Project: flink   Source File: AkkaRpcActorTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Tests that actors are properly terminated when the AkkaRpcService is shut down.
 */
@Test
public void testActorTerminationWhenServiceShutdown() throws Exception {
	final ActorSystem rpcActorSystem = AkkaUtils.createDefaultActorSystem();
	final RpcService rpcService = new AkkaRpcService(
		rpcActorSystem, AkkaRpcServiceConfiguration.defaultConfiguration());

	try {
		SimpleRpcEndpoint rpcEndpoint = new SimpleRpcEndpoint(rpcService, SimpleRpcEndpoint.class.getSimpleName());

		rpcEndpoint.start();

		CompletableFuture<Void> terminationFuture = rpcEndpoint.getTerminationFuture();

		rpcService.stopService();

		terminationFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
	} finally {
		rpcActorSystem.terminate();
		Await.ready(rpcActorSystem.whenTerminated(), FutureUtils.toFiniteDuration(timeout));
	}
}
 
Example 15
Source Project: flink   Source File: DispatcherTest.java    License: 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 16
ResourceManagerRegistration(
		Logger log,
		RpcService rpcService,
		String targetAddress,
		ResourceManagerId resourceManagerId,
		RetryingRegistrationConfiguration retryingRegistrationConfiguration,
		String taskExecutorAddress,
		ResourceID resourceID,
		int dataPort,
		HardwareDescription hardwareDescription) {

	super(log, rpcService, "ResourceManager", ResourceManagerGateway.class, targetAddress, resourceManagerId, retryingRegistrationConfiguration);
	this.taskExecutorAddress = checkNotNull(taskExecutorAddress);
	this.resourceID = checkNotNull(resourceID);
	this.dataPort = dataPort;
	this.hardwareDescription = checkNotNull(hardwareDescription);
}
 
Example 17
Source Project: flink   Source File: TaskManagerRunnerConfigurationTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testTaskManagerRpcServiceShouldBindToConfiguredTaskManagerHostname() throws Exception {
	final String taskmanagerHost = "testhostname";
	final Configuration config = createFlinkConfigWithPredefinedTaskManagerHostname(taskmanagerHost);
	final HighAvailabilityServices highAvailabilityServices = createHighAvailabilityServices(config);

	RpcService taskManagerRpcService = null;
	try {
		taskManagerRpcService = TaskManagerRunner.createRpcService(config, highAvailabilityServices);

		assertThat(taskManagerRpcService.getPort(), is(greaterThanOrEqualTo(0)));
		assertThat(taskManagerRpcService.getAddress(), is(equalTo(taskmanagerHost)));
	} finally {
		maybeCloseRpcService(taskManagerRpcService);
		highAvailabilityServices.closeAndCleanupAllData();
	}
}
 
Example 18
Source Project: flink   Source File: TaskSubmissionTestEnvironment.java    License: Apache License 2.0 6 votes vote down vote up
static void registerJobMasterConnection(
		JobTable jobTable,
		JobID jobId,
		RpcService testingRpcService,
		JobMasterGateway jobMasterGateway,
		TaskManagerActions taskManagerActions,
		Time timeout,
		MainThreadExecutable mainThreadExecutable) {
	mainThreadExecutable.runAsync(() -> {
		final JobTable.Job job = jobTable.getOrCreateJob(jobId, () -> TestingJobServices.newBuilder().build());
		job.connect(
			ResourceID.generate(),
			jobMasterGateway,
			taskManagerActions,
			new TestCheckpointResponder(),
			new TestGlobalAggregateManager(),
			new RpcResultPartitionConsumableNotifier(jobMasterGateway, testingRpcService.getExecutor(), timeout),
			TestingPartitionProducerStateChecker.newBuilder()
				.setPartitionProducerStateFunction((jobID, intermediateDataSetID, resultPartitionID) -> CompletableFuture.completedFuture(ExecutionState.RUNNING))
				.build());
	});
}
 
Example 19
Source Project: flink   Source File: MiniCluster.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Factory method to instantiate the remote RPC service.
 *
 * @param configuration Flink configuration.
 * @param externalAddress The external address to access the RPC service.
 * @param externalPortRange The external port range to access the RPC service.
 * @param bindAddress The address to bind the RPC service to.
 * @return The instantiated RPC service
 */
protected RpcService createRemoteRpcService(
	Configuration configuration,
	String externalAddress,
	String externalPortRange,
	String bindAddress) throws Exception {
	return AkkaRpcServiceUtils.remoteServiceBuilder(configuration, externalAddress, externalPortRange)
		.withBindAddress(bindAddress)
		.withCustomConfig(AkkaUtils.testDispatcherConfig())
		.createAndStart();
}
 
Example 20
Source Project: flink   Source File: StandaloneResourceManager.java    License: Apache License 2.0 5 votes vote down vote up
public StandaloneResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup,
		Time startupPeriodTime) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		jobManagerMetricGroup);
	this.startupPeriodTime = Preconditions.checkNotNull(startupPeriodTime);
}
 
Example 21
Source Project: Flink-CEPplus   Source File: MesosResourceManagerFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ResourceManager<RegisteredMesosWorkerNode> createResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		JobManagerMetricGroup jobManagerMetricGroup) throws Exception {
	final ResourceManagerRuntimeServicesConfiguration rmServicesConfiguration = ResourceManagerRuntimeServicesConfiguration.fromConfiguration(configuration);
	final ResourceManagerRuntimeServices rmRuntimeServices = ResourceManagerRuntimeServices.fromConfiguration(
		rmServicesConfiguration,
		highAvailabilityServices,
		rpcService.getScheduledExecutor());

	return new MesosResourceManager(
		rpcService,
		getEndpointId(),
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		rmRuntimeServices.getSlotManager(),
		metricRegistry,
		rmRuntimeServices.getJobLeaderIdService(),
		clusterInformation,
		fatalErrorHandler,
		configuration,
		mesosServices,
		schedulerConfiguration,
		taskManagerParameters,
		taskManagerContainerSpec,
		webInterfaceUrl,
		jobManagerMetricGroup);
}
 
Example 22
Source Project: Flink-CEPplus   Source File: YarnResourceManagerTest.java    License: Apache License 2.0 5 votes vote down vote up
TestingYarnResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		Configuration flinkConfig,
		Map<String, String> env,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		@Nullable String webInterfaceUrl,
		AMRMClientAsync<AMRMClient.ContainerRequest> mockResourceManagerClient,
		NMClient mockNMClient,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		flinkConfig,
		env,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		webInterfaceUrl,
		jobManagerMetricGroup);
	this.mockNMClient = mockNMClient;
	this.mockResourceManagerClient = mockResourceManagerClient;
}
 
Example 23
Source Project: flink   Source File: ClusterEntrypoint.java    License: Apache License 2.0 5 votes vote down vote up
protected void initializeServices(Configuration configuration) throws Exception {

		LOG.info("Initializing cluster services.");

		synchronized (lock) {
			final String bindAddress = configuration.getString(JobManagerOptions.ADDRESS);
			final String portRange = getRPCPortRange(configuration);

			commonRpcService = createRpcService(configuration, bindAddress, portRange);

			// update the configuration used to create the high availability services
			configuration.setString(JobManagerOptions.ADDRESS, commonRpcService.getAddress());
			configuration.setInteger(JobManagerOptions.PORT, commonRpcService.getPort());

			ioExecutor = Executors.newFixedThreadPool(
				Hardware.getNumberCPUCores(),
				new ExecutorThreadFactory("cluster-io"));
			haServices = createHaServices(configuration, ioExecutor);
			blobServer = new BlobServer(configuration, haServices.createBlobStore());
			blobServer.start();
			heartbeatServices = createHeartbeatServices(configuration);
			metricRegistry = createMetricRegistry(configuration);

			final RpcService metricQueryServiceRpcService = MetricUtils.startMetricsRpcService(configuration, bindAddress);
			metricRegistry.startQueryService(metricQueryServiceRpcService, null);

			archivedExecutionGraphStore = createSerializableExecutionGraphStore(configuration, commonRpcService.getScheduledExecutor());
		}
	}
 
Example 24
Source Project: flink   Source File: ClusterEntrypoint.java    License: Apache License 2.0 5 votes vote down vote up
protected void initializeServices(Configuration configuration, PluginManager pluginManager) throws Exception {

		LOG.info("Initializing cluster services.");

		synchronized (lock) {
			commonRpcService = AkkaRpcServiceUtils.createRemoteRpcService(
				configuration,
				configuration.getString(JobManagerOptions.ADDRESS),
				getRPCPortRange(configuration),
				configuration.getString(JobManagerOptions.BIND_HOST),
				configuration.getOptional(JobManagerOptions.RPC_BIND_PORT));

			// update the configuration used to create the high availability services
			configuration.setString(JobManagerOptions.ADDRESS, commonRpcService.getAddress());
			configuration.setInteger(JobManagerOptions.PORT, commonRpcService.getPort());

			ioExecutor = Executors.newFixedThreadPool(
				ClusterEntrypointUtils.getPoolSize(configuration),
				new ExecutorThreadFactory("cluster-io"));
			haServices = createHaServices(configuration, ioExecutor);
			blobServer = new BlobServer(configuration, haServices.createBlobStore());
			blobServer.start();
			heartbeatServices = createHeartbeatServices(configuration);
			metricRegistry = createMetricRegistry(configuration, pluginManager);

			final RpcService metricQueryServiceRpcService = MetricUtils.startRemoteMetricsRpcService(configuration, commonRpcService.getAddress());
			metricRegistry.startQueryService(metricQueryServiceRpcService, null);

			final String hostname = RpcUtils.getHostname(commonRpcService);

			processMetricGroup = MetricUtils.instantiateProcessMetricGroup(
				metricRegistry,
				hostname,
				ConfigurationUtils.getSystemResourceMetricsProbingInterval(configuration));

			archivedExecutionGraphStore = createSerializableExecutionGraphStore(configuration, commonRpcService.getScheduledExecutor());
		}
	}
 
Example 25
Source Project: flink   Source File: MiniDispatcher.java    License: Apache License 2.0 5 votes vote down vote up
public MiniDispatcher(
		RpcService rpcService,
		DispatcherId fencingToken,
		DispatcherServices dispatcherServices,
		DispatcherBootstrap dispatcherBootstrap,
		JobClusterEntrypoint.ExecutionMode executionMode) throws Exception {
	super(
		rpcService,
		fencingToken,
		dispatcherBootstrap,
		dispatcherServices);

	this.executionMode = checkNotNull(executionMode);
}
 
Example 26
Source Project: Flink-CEPplus   Source File: MiniDispatcher.java    License: Apache License 2.0 5 votes vote down vote up
public MiniDispatcher(
		RpcService rpcService,
		String endpointId,
		Configuration configuration,
		HighAvailabilityServices highAvailabilityServices,
		GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		JobManagerMetricGroup jobManagerMetricGroup,
		@Nullable String metricQueryServicePath,
		ArchivedExecutionGraphStore archivedExecutionGraphStore,
		JobManagerRunnerFactory jobManagerRunnerFactory,
		FatalErrorHandler fatalErrorHandler,
		HistoryServerArchivist historyServerArchivist,
		JobGraph jobGraph,
		JobClusterEntrypoint.ExecutionMode executionMode) throws Exception {
	super(
		rpcService,
		endpointId,
		configuration,
		highAvailabilityServices,
		new SingleJobSubmittedJobGraphStore(jobGraph),
		resourceManagerGatewayRetriever,
		blobServer,
		heartbeatServices,
		jobManagerMetricGroup,
		metricQueryServicePath,
		archivedExecutionGraphStore,
		jobManagerRunnerFactory,
		fatalErrorHandler,
		historyServerArchivist);

	this.executionMode = checkNotNull(executionMode);
	this.jobTerminationFuture = new CompletableFuture<>();
}
 
Example 27
Source Project: Flink-CEPplus   Source File: StandaloneDispatcher.java    License: Apache License 2.0 5 votes vote down vote up
public StandaloneDispatcher(
		RpcService rpcService,
		String endpointId,
		Configuration configuration,
		HighAvailabilityServices highAvailabilityServices,
		GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		JobManagerMetricGroup jobManagerMetricGroup,
		@Nullable String metricQueryServicePath,
		ArchivedExecutionGraphStore archivedExecutionGraphStore,
		JobManagerRunnerFactory jobManagerRunnerFactory,
		FatalErrorHandler fatalErrorHandler,
		HistoryServerArchivist historyServerArchivist) throws Exception {
	super(
		rpcService,
		endpointId,
		configuration,
		highAvailabilityServices,
		highAvailabilityServices.getSubmittedJobGraphStore(),
		resourceManagerGatewayRetriever,
		blobServer,
		heartbeatServices,
		jobManagerMetricGroup,
		metricQueryServicePath,
		archivedExecutionGraphStore,
		jobManagerRunnerFactory,
		fatalErrorHandler,
		historyServerArchivist);
}
 
Example 28
Source Project: flink   Source File: TestingJobManagerRunnerFactory.java    License: 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 29
DispatcherResourceManagerComponent create(
Configuration configuration,
Executor ioExecutor,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
BlobServer blobServer,
HeartbeatServices heartbeatServices,
MetricRegistry metricRegistry,
ArchivedExecutionGraphStore archivedExecutionGraphStore,
MetricQueryServiceRetriever metricQueryServiceRetriever,
FatalErrorHandler fatalErrorHandler) throws Exception;
 
Example 30
DefaultDispatcherGatewayServiceFactory(
		DispatcherFactory dispatcherFactory,
		RpcService rpcService,
		PartialDispatcherServices partialDispatcherServices) {
	this.dispatcherFactory = dispatcherFactory;
	this.rpcService = rpcService;
	this.partialDispatcherServices = partialDispatcherServices;
}