org.apache.flink.runtime.rest.RestServerEndpointConfiguration Java Examples

The following examples show how to use org.apache.flink.runtime.rest.RestServerEndpointConfiguration. 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-CEPplus   Author: ljygz   File: DispatcherRestEndpoint.java    License: Apache License 2.0 6 votes vote down vote up
public DispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<DispatcherGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {

	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		fatalErrorHandler);

	webSubmissionExtension = WebMonitorExtension.empty();
}
 
Example #2
Source Project: Flink-CEPplus   Author: ljygz   File: MiniDispatcherRestEndpoint.java    License: Apache License 2.0 6 votes vote down vote up
public MiniDispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		fatalErrorHandler);
}
 
Example #3
Source Project: flink   Author: flink-tpc-ds   File: DispatcherRestEndpoint.java    License: Apache License 2.0 6 votes vote down vote up
public DispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<DispatcherGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {

	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		fatalErrorHandler);

	webSubmissionExtension = WebMonitorExtension.empty();
}
 
Example #4
Source Project: flink   Author: flink-tpc-ds   File: MiniDispatcherRestEndpoint.java    License: Apache License 2.0 6 votes vote down vote up
public MiniDispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		fatalErrorHandler);
}
 
Example #5
Source Project: flink   Author: apache   File: MiniDispatcherRestEndpoint.java    License: Apache License 2.0 6 votes vote down vote up
public MiniDispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ScheduledExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		ExecutionGraphCache executionGraphCache,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		executionGraphCache,
		fatalErrorHandler);
}
 
Example #6
Source Project: Flink-CEPplus   Author: ljygz   File: WebMonitorEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
public WebMonitorEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends T> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(endpointConfiguration);
	this.leaderRetriever = Preconditions.checkNotNull(leaderRetriever);
	this.clusterConfiguration = Preconditions.checkNotNull(clusterConfiguration);
	this.restConfiguration = Preconditions.checkNotNull(restConfiguration);
	this.resourceManagerRetriever = Preconditions.checkNotNull(resourceManagerRetriever);
	this.transientBlobService = Preconditions.checkNotNull(transientBlobService);
	this.executor = Preconditions.checkNotNull(executor);

	this.executionGraphCache = new ExecutionGraphCache(
		restConfiguration.getTimeout(),
		Time.milliseconds(restConfiguration.getRefreshInterval()));

	this.checkpointStatsCache = new CheckpointStatsCache(
		restConfiguration.getMaxCheckpointStatisticCacheEntries());

	this.metricFetcher = metricFetcher;

	this.leaderElectionService = Preconditions.checkNotNull(leaderElectionService);
	this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);
}
 
Example #7
Source Project: Flink-CEPplus   Author: ljygz   File: TestRestServerEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
static TestRestServerEndpoint createAndStartRestServerEndpoint(
		final RestServerEndpointConfiguration restServerEndpointConfiguration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws Exception {
	final TestRestServerEndpoint testRestServerEndpoint = new TestRestServerEndpoint(restServerEndpointConfiguration, abstractRestHandlers);
	testRestServerEndpoint.start();
	return testRestServerEndpoint;
}
 
Example #8
Source Project: Flink-CEPplus   Author: ljygz   File: RestClusterClientTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(restConfig);
	mockGatewayRetriever = () -> CompletableFuture.completedFuture(mockRestfulGateway);

	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientTest.class.getSimpleName()));

	jobGraph = new JobGraph("testjob");
	jobId = jobGraph.getJobID();
}
 
Example #9
Source Project: flink   Author: flink-tpc-ds   File: WebMonitorEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
public WebMonitorEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends T> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(endpointConfiguration);
	this.leaderRetriever = Preconditions.checkNotNull(leaderRetriever);
	this.clusterConfiguration = Preconditions.checkNotNull(clusterConfiguration);
	this.restConfiguration = Preconditions.checkNotNull(restConfiguration);
	this.resourceManagerRetriever = Preconditions.checkNotNull(resourceManagerRetriever);
	this.transientBlobService = Preconditions.checkNotNull(transientBlobService);
	this.executor = Preconditions.checkNotNull(executor);

	this.executionGraphCache = new ExecutionGraphCache(
		restConfiguration.getTimeout(),
		Time.milliseconds(restConfiguration.getRefreshInterval()));

	this.checkpointStatsCache = new CheckpointStatsCache(
		restConfiguration.getMaxCheckpointStatisticCacheEntries());

	this.metricFetcher = metricFetcher;

	this.leaderElectionService = Preconditions.checkNotNull(leaderElectionService);
	this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);
}
 
Example #10
Source Project: flink   Author: flink-tpc-ds   File: TestRestServerEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
static TestRestServerEndpoint createAndStartRestServerEndpoint(
		final RestServerEndpointConfiguration restServerEndpointConfiguration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws Exception {
	final TestRestServerEndpoint testRestServerEndpoint = new TestRestServerEndpoint(restServerEndpointConfiguration, abstractRestHandlers);
	testRestServerEndpoint.start();
	return testRestServerEndpoint;
}
 
Example #11
Source Project: flink   Author: flink-tpc-ds   File: RestClusterClientTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(restConfig);
	mockGatewayRetriever = () -> CompletableFuture.completedFuture(mockRestfulGateway);

	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientTest.class.getSimpleName()));

	jobGraph = new JobGraph("testjob");
	jobId = jobGraph.getJobID();
}
 
Example #12
Source Project: flink   Author: apache   File: DispatcherRestEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
public DispatcherRestEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<DispatcherGateway> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ScheduledExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		ExecutionGraphCache executionGraphCache,
		FatalErrorHandler fatalErrorHandler) throws IOException {

	super(
		endpointConfiguration,
		leaderRetriever,
		clusterConfiguration,
		restConfiguration,
		resourceManagerRetriever,
		transientBlobService,
		executor,
		metricFetcher,
		leaderElectionService,
		executionGraphCache,
		fatalErrorHandler);

	webSubmissionExtension = WebMonitorExtension.empty();
}
 
Example #13
Source Project: flink   Author: apache   File: WebMonitorEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
public WebMonitorEndpoint(
		RestServerEndpointConfiguration endpointConfiguration,
		GatewayRetriever<? extends T> leaderRetriever,
		Configuration clusterConfiguration,
		RestHandlerConfiguration restConfiguration,
		GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
		TransientBlobService transientBlobService,
		ScheduledExecutorService executor,
		MetricFetcher metricFetcher,
		LeaderElectionService leaderElectionService,
		ExecutionGraphCache executionGraphCache,
		FatalErrorHandler fatalErrorHandler) throws IOException {
	super(endpointConfiguration);
	this.leaderRetriever = Preconditions.checkNotNull(leaderRetriever);
	this.clusterConfiguration = Preconditions.checkNotNull(clusterConfiguration);
	this.restConfiguration = Preconditions.checkNotNull(restConfiguration);
	this.resourceManagerRetriever = Preconditions.checkNotNull(resourceManagerRetriever);
	this.transientBlobService = Preconditions.checkNotNull(transientBlobService);
	this.executor = Preconditions.checkNotNull(executor);

	this.executionGraphCache = executionGraphCache;

	this.checkpointStatsCache = new CheckpointStatsCache(
		restConfiguration.getMaxCheckpointStatisticCacheEntries());

	this.metricFetcher = metricFetcher;

	this.leaderElectionService = Preconditions.checkNotNull(leaderElectionService);
	this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);
}
 
Example #14
Source Project: flink   Author: apache   File: WebMonitorEndpointTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void cleansUpExpiredExecutionGraphs() throws Exception {
	final Configuration configuration = new Configuration();
	configuration.setString(RestOptions.ADDRESS, "localhost");
	configuration.setLong(WebOptions.REFRESH_INTERVAL, 5L);
	final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
	final long timeout = 10000L;

	final OneShotLatch cleanupLatch = new OneShotLatch();
	final TestingExecutionGraphCache executionGraphCache = TestingExecutionGraphCache.newBuilder()
		.setCleanupRunnable(cleanupLatch::trigger)
		.build();
	try (final WebMonitorEndpoint<RestfulGateway> webMonitorEndpoint = new WebMonitorEndpoint<>(
		RestServerEndpointConfiguration.fromConfiguration(configuration),
		CompletableFuture::new,
		configuration,
		RestHandlerConfiguration.fromConfiguration(configuration),
		CompletableFuture::new,
		NoOpTransientBlobService.INSTANCE,
		executor,
		VoidMetricFetcher.INSTANCE,
		new TestingLeaderElectionService(),
		executionGraphCache,
		new TestingFatalErrorHandler())) {

		webMonitorEndpoint.start();

		// check that the cleanup will be triggered
		cleanupLatch.await(timeout, TimeUnit.MILLISECONDS);
	} finally {
		ExecutorUtils.gracefulShutdown(timeout, TimeUnit.MILLISECONDS, executor);
	}
}
 
Example #15
Source Project: flink   Author: apache   File: TestRestServerEndpoint.java    License: Apache License 2.0 5 votes vote down vote up
static TestRestServerEndpoint createAndStartRestServerEndpoint(
		final RestServerEndpointConfiguration restServerEndpointConfiguration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws Exception {
	final TestRestServerEndpoint testRestServerEndpoint = new TestRestServerEndpoint(restServerEndpointConfiguration, abstractRestHandlers);
	testRestServerEndpoint.start();
	return testRestServerEndpoint;
}
 
Example #16
Source Project: flink   Author: apache   File: RestClusterClientTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(restConfig);
	mockGatewayRetriever = () -> CompletableFuture.completedFuture(mockRestfulGateway);

	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientTest.class.getSimpleName()));

	jobGraph = new JobGraph("testjob");
	jobId = jobGraph.getJobID();
}
 
Example #17
Source Project: Flink-CEPplus   Author: ljygz   File: RestClusterClientSavepointTriggerTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void setUp() throws ConfigurationException {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(REST_CONFIG);
	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientSavepointTriggerTest.class.getSimpleName()));
}
 
Example #18
Source Project: Flink-CEPplus   Author: ljygz   File: TestRestServerEndpoint.java    License: Apache License 2.0 4 votes vote down vote up
TestRestServerEndpoint(
		final RestServerEndpointConfiguration configuration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws IOException {
	super(configuration);
	this.abstractRestHandlers = abstractRestHandlers;
}
 
Example #19
Source Project: flink   Author: flink-tpc-ds   File: RestClusterClientSavepointTriggerTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void setUp() throws ConfigurationException {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(REST_CONFIG);
	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientSavepointTriggerTest.class.getSimpleName()));
}
 
Example #20
Source Project: flink   Author: flink-tpc-ds   File: TestRestServerEndpoint.java    License: Apache License 2.0 4 votes vote down vote up
TestRestServerEndpoint(
		final RestServerEndpointConfiguration configuration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws IOException {
	super(configuration);
	this.abstractRestHandlers = abstractRestHandlers;
}
 
Example #21
Source Project: flink   Author: apache   File: RestClusterClientSavepointTriggerTest.java    License: Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void setUp() throws ConfigurationException {
	restServerEndpointConfiguration = RestServerEndpointConfiguration.fromConfiguration(REST_CONFIG);
	executor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory(RestClusterClientSavepointTriggerTest.class.getSimpleName()));
}
 
Example #22
Source Project: flink   Author: apache   File: TestRestServerEndpoint.java    License: Apache License 2.0 4 votes vote down vote up
TestRestServerEndpoint(
		final RestServerEndpointConfiguration configuration,
		final AbstractRestHandler<?, ?, ?, ?>... abstractRestHandlers) throws IOException {
	super(configuration);
	this.abstractRestHandlers = abstractRestHandlers;
}