org.apache.flink.runtime.rest.messages.MessageHeaders Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.MessageHeaders. 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: JobDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JobDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobDetailsInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		MetricFetcher metricFetcher) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);

	this.metricFetcher = Preconditions.checkNotNull(metricFetcher);
}
 
Example #2
Source File: JarPlanHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JarPlanHandler(
		final GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		final Time timeout,
		final Map<String, String> responseHeaders,
		final MessageHeaders<JarPlanRequestBody, JobPlanInfo, JarPlanMessageParameters> messageHeaders,
		final Path jarDir,
		final Configuration configuration,
		final Executor executor) {
	this(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		jarDir,
		configuration,
		executor,
		jobGraph -> new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph)));
}
 
Example #3
Source File: JarPlanHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JarPlanHandler(
		final GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		final Time timeout,
		final Map<String, String> responseHeaders,
		final MessageHeaders<JarPlanRequestBody, JobPlanInfo, JarPlanMessageParameters> messageHeaders,
		final Path jarDir,
		final Configuration configuration,
		final Executor executor) {
	this(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		jarDir,
		configuration,
		executor,
		jobGraph -> new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph)));
}
 
Example #4
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public TaskCheckpointStatisticDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, TaskCheckpointStatisticsWithSubtaskDetails, TaskCheckpointMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		CheckpointStatsCache checkpointStatsCache) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor,
		checkpointStatsCache);
}
 
Example #5
Source File: JobExceptionsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobExceptionsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobExceptionsInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #6
Source File: RestClusterClientTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Nonnull
private RestClient createRestClient() throws ConfigurationException {
	return new RestClient(RestClientConfiguration.fromConfiguration(restConfig), executor) {
		@Override
		public <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P>
		sendRequest(
			final String targetAddress,
			final int targetPort,
			final M messageHeaders,
			final U messageParameters,
			final R request,
			final Collection<FileUpload> files) throws IOException {
			if (failHttpRequest.test(messageHeaders, messageParameters, request)) {
				return FutureUtils.completedExceptionally(new IOException("expected"));
			} else {
				return super.sendRequest(targetAddress, targetPort, messageHeaders, messageParameters, request, files);
			}
		}
	};
}
 
Example #7
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobVertexDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobVertexDetailsInfo, JobVertexMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		MetricFetcher metricFetcher) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
	this.metricFetcher = metricFetcher;
}
 
Example #8
Source File: RestClient.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P> sendRequest(
		String targetAddress,
		int targetPort,
		M messageHeaders,
		U messageParameters,
		R request,
		Collection<FileUpload> fileUploads) throws IOException {
	return sendRequest(
		targetAddress,
		targetPort,
		messageHeaders,
		messageParameters,
		request,
		fileUploads,
		RestAPIVersion.getLatestVersion(messageHeaders.getSupportedAPIVersions()));
}
 
Example #9
Source File: TaskCheckpointStatisticDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public TaskCheckpointStatisticDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, TaskCheckpointStatisticsWithSubtaskDetails, TaskCheckpointMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		CheckpointStatsCache checkpointStatsCache) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor,
		checkpointStatsCache);
}
 
Example #10
Source File: CheckpointStatisticDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public CheckpointStatisticDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, CheckpointStatistics, CheckpointMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		CheckpointStatsCache checkpointStatsCache) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor,
		checkpointStatsCache);
}
 
Example #11
Source File: CheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public CheckpointStatisticDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, CheckpointStatistics, CheckpointMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		CheckpointStatsCache checkpointStatsCache) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor,
		checkpointStatsCache);
}
 
Example #12
Source File: JobConfigHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobConfigHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobConfigInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #13
Source File: RestClient.java    From flink with Apache License 2.0 6 votes vote down vote up
public <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P> sendRequest(
		String targetAddress,
		int targetPort,
		M messageHeaders,
		U messageParameters,
		R request,
		Collection<FileUpload> fileUploads) throws IOException {
	return sendRequest(
		targetAddress,
		targetPort,
		messageHeaders,
		messageParameters,
		request,
		fileUploads,
		RestAPIVersion.getLatestVersion(messageHeaders.getSupportedAPIVersions()));
}
 
Example #14
Source File: JobExceptionsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JobExceptionsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobExceptionsInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #15
Source File: JobConfigHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JobConfigHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobConfigInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #16
Source File: JobPlanHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobPlanHandler(
	GatewayRetriever<? extends RestfulGateway> leaderRetriever,
	Time timeout,
	Map<String, String> headers,
	MessageHeaders<EmptyRequestBody, JobPlanInfo, JobMessageParameters> messageHeaders,
	ExecutionGraphCache executionGraphCache,
	Executor executor) {

	super(
		leaderRetriever,
		timeout,
		headers,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #17
Source File: AbstractAsynchronousOperationHandlers.java    From flink with Apache License 2.0 5 votes vote down vote up
protected StatusHandler(
		GatewayRetriever<? extends T> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, AsynchronousOperationResult<V>, M> messageHeaders) {
	super(leaderRetriever, timeout, responseHeaders, messageHeaders);
}
 
Example #18
Source File: RestClusterClient.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P>
sendRetriableRequest(M messageHeaders, U messageParameters, R request, Collection<FileUpload> filesToUpload, Predicate<Throwable> retryPredicate) {
	return retry(() -> getWebMonitorBaseUrl().thenCompose(webMonitorBaseUrl -> {
		try {
			return restClient.sendRequest(webMonitorBaseUrl.getHost(), webMonitorBaseUrl.getPort(), messageHeaders, messageParameters, request, filesToUpload);
		} catch (IOException e) {
			throw new CompletionException(e);
		}
	}), retryPredicate);
}
 
Example #19
Source File: SubtasksTimesHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
public SubtasksTimesHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, SubtasksTimesInfo, JobVertexMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #20
Source File: RestClusterClient.java    From flink with Apache License 2.0 5 votes vote down vote up
private <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P>
sendRetriableRequest(M messageHeaders, U messageParameters, R request, Collection<FileUpload> filesToUpload, Predicate<Throwable> retryPredicate) {
	return retry(() -> getWebMonitorBaseUrl().thenCompose(webMonitorBaseUrl -> {
		try {
			return restClient.sendRequest(webMonitorBaseUrl.getHost(), webMonitorBaseUrl.getPort(), messageHeaders, messageParameters, request, filesToUpload);
		} catch (IOException e) {
			throw new CompletionException(e);
		}
	}), retryPredicate);
}
 
Example #21
Source File: AbstractJobVertexHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Instantiates a new Abstract job vertex handler.
 *
 * @param leaderRetriever     the leader retriever
 * @param timeout             the timeout
 * @param responseHeaders     the response headers
 * @param messageHeaders      the message headers
 * @param executionGraphCache the execution graph cache
 * @param executor            the executor
 */
protected AbstractJobVertexHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, R, M> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(leaderRetriever, timeout, responseHeaders, messageHeaders, executionGraphCache, executor);
}
 
Example #22
Source File: ClusterConfigHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public ClusterConfigHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, ClusterConfigurationInfo, EmptyMessageParameters> messageHeaders,
		Configuration configuration) {
	super(leaderRetriever, timeout, responseHeaders, messageHeaders);

	Preconditions.checkNotNull(configuration);
	this.clusterConfig = ClusterConfigurationInfo.from(configuration);
}
 
Example #23
Source File: ClusterOverviewHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public ClusterOverviewHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, ClusterOverviewWithVersion, EmptyMessageParameters> messageHeaders) {
	super(leaderRetriever, timeout, responseHeaders, messageHeaders);
}
 
Example #24
Source File: AbstractTaskManagerHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
protected AbstractTaskManagerHandler(
		GatewayRetriever<? extends T> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<R, P, M> messageHeaders,
		GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever) {
	super(leaderRetriever, timeout, responseHeaders, messageHeaders);

	this.resourceManagerGatewayRetriever = Preconditions.checkNotNull(resourceManagerGatewayRetriever);
}
 
Example #25
Source File: AbstractSubtaskAttemptHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Instantiates a new Abstract job vertex handler.
 *
 * @param leaderRetriever     the leader retriever
 * @param timeout             the timeout
 * @param responseHeaders     the response headers
 * @param messageHeaders      the message headers
 * @param executionGraphCache the execution graph cache
 * @param executor            the executor
 */
protected AbstractSubtaskAttemptHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, R, M> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {

	super(leaderRetriever, timeout, responseHeaders, messageHeaders, executionGraphCache, executor);
}
 
Example #26
Source File: AbstractMetricsHandlerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private TestMetricsHandler(
	GatewayRetriever<DispatcherGateway> leaderRetriever,
	Time timeout,
	Map<String, String> headers,
	MessageHeaders<EmptyRequestBody,
		MetricCollectionResponseBody,
		TestMessageParameters> messageHeaders,
	MetricFetcher metricFetcher) {

	super(leaderRetriever, timeout, headers, messageHeaders, metricFetcher);
}
 
Example #27
Source File: CheckpointConfigHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
public CheckpointConfigHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, CheckpointConfigInfo, JobMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
}
 
Example #28
Source File: AbstractRestHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
protected AbstractRestHandler(
		GatewayRetriever<? extends T> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<R, P, M> messageHeaders) {
	super(leaderRetriever, timeout, responseHeaders, messageHeaders);
	this.messageHeaders = Preconditions.checkNotNull(messageHeaders);
}
 
Example #29
Source File: RestAPIDocGenerator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static void createHtmlFile(DocumentingRestEndpoint restEndpoint, RestAPIVersion apiVersion, Path outputFile) throws IOException {
	StringBuilder html = new StringBuilder();

	List<MessageHeaders> specs = restEndpoint.getSpecs().stream()
		.filter(spec -> spec.getSupportedAPIVersions().contains(apiVersion))
		.collect(Collectors.toList());
	specs.forEach(spec -> html.append(createHtmlEntry(spec)));

	Files.deleteIfExists(outputFile);
	Files.write(outputFile, html.toString().getBytes(StandardCharsets.UTF_8));
}
 
Example #30
Source File: JobIdsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
public JobIdsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobIdsWithStatusOverview, EmptyMessageParameters> messageHeaders) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders);
}