org.apache.flink.runtime.rest.messages.job.savepoints.SavepointStatusMessageParameters Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.job.savepoints.SavepointStatusMessageParameters. 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: SavepointHandlersTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> savepointStatusRequest(
		final TriggerId triggerId) throws HandlerRequestException {
		final Map<String, String> pathParameters = new HashMap<>();
	pathParameters.put(JobIDPathParameter.KEY, JOB_ID.toString());
	pathParameters.put(TriggerIdPathParameter.KEY, triggerId.toString());

	return new HandlerRequest<>(
		EmptyRequestBody.getInstance(),
		new SavepointStatusMessageParameters(),
		pathParameters,
		Collections.emptyMap());
}
 
Example #2
Source File: RestClusterClient.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private CompletableFuture<SavepointInfo> pollSavepointAsync(
		final JobID jobId,
		final TriggerId triggerID) {
	return pollResourceAsync(() -> {
		final SavepointStatusHeaders savepointStatusHeaders = SavepointStatusHeaders.getInstance();
		final SavepointStatusMessageParameters savepointStatusMessageParameters =
			savepointStatusHeaders.getUnresolvedMessageParameters();
		savepointStatusMessageParameters.jobIdPathParameter.resolve(jobId);
		savepointStatusMessageParameters.triggerIdPathParameter.resolve(triggerID);
		return sendRequest(
			savepointStatusHeaders,
			savepointStatusMessageParameters);
	});
}
 
Example #3
Source File: RestClusterClientSavepointTriggerTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected CompletableFuture<AsynchronousOperationResult<SavepointInfo>> handleRequest(
		@Nonnull HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request,
		@Nonnull DispatcherGateway gateway) throws RestHandlerException {

	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	return CompletableFuture.completedFuture(AsynchronousOperationResult.completed(savepointHandlerLogic.apply(triggerId)));
}
 
Example #4
Source File: SavepointHandlersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> savepointStatusRequest(
		final TriggerId triggerId) throws HandlerRequestException {
		final Map<String, String> pathParameters = new HashMap<>();
	pathParameters.put(JobIDPathParameter.KEY, JOB_ID.toString());
	pathParameters.put(TriggerIdPathParameter.KEY, triggerId.toString());

	return new HandlerRequest<>(
		EmptyRequestBody.getInstance(),
		new SavepointStatusMessageParameters(),
		pathParameters,
		Collections.emptyMap());
}
 
Example #5
Source File: StopWithSavepointHandlersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> savepointStatusRequest(
		final TriggerId triggerId) throws HandlerRequestException {
	final Map<String, String> pathParameters = new HashMap<>();
	pathParameters.put(JobIDPathParameter.KEY, JOB_ID.toString());
	pathParameters.put(TriggerIdPathParameter.KEY, triggerId.toString());

	return new HandlerRequest<>(
			EmptyRequestBody.getInstance(),
			new SavepointStatusMessageParameters(),
			pathParameters,
			Collections.emptyMap());
}
 
Example #6
Source File: RestClusterClient.java    From flink with Apache License 2.0 5 votes vote down vote up
private CompletableFuture<SavepointInfo> pollSavepointAsync(
		final JobID jobId,
		final TriggerId triggerID) {
	return pollResourceAsync(() -> {
		final SavepointStatusHeaders savepointStatusHeaders = SavepointStatusHeaders.getInstance();
		final SavepointStatusMessageParameters savepointStatusMessageParameters =
			savepointStatusHeaders.getUnresolvedMessageParameters();
		savepointStatusMessageParameters.jobIdPathParameter.resolve(jobId);
		savepointStatusMessageParameters.triggerIdPathParameter.resolve(triggerID);
		return sendRequest(
			savepointStatusHeaders,
			savepointStatusMessageParameters);
	});
}
 
Example #7
Source File: RestClusterClientSavepointTriggerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected CompletableFuture<AsynchronousOperationResult<SavepointInfo>> handleRequest(
		@Nonnull HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request,
		@Nonnull DispatcherGateway gateway) throws RestHandlerException {

	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	return CompletableFuture.completedFuture(AsynchronousOperationResult.completed(savepointHandlerLogic.apply(triggerId)));
}
 
Example #8
Source File: SavepointHandlersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> savepointStatusRequest(
		final TriggerId triggerId) throws HandlerRequestException {
		final Map<String, String> pathParameters = new HashMap<>();
	pathParameters.put(JobIDPathParameter.KEY, JOB_ID.toString());
	pathParameters.put(TriggerIdPathParameter.KEY, triggerId.toString());

	return new HandlerRequest<>(
		EmptyRequestBody.getInstance(),
		new SavepointStatusMessageParameters(),
		pathParameters,
		Collections.emptyMap());
}
 
Example #9
Source File: StopWithSavepointHandlersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> savepointStatusRequest(
		final TriggerId triggerId) throws HandlerRequestException {
	final Map<String, String> pathParameters = new HashMap<>();
	pathParameters.put(JobIDPathParameter.KEY, JOB_ID.toString());
	pathParameters.put(TriggerIdPathParameter.KEY, triggerId.toString());

	return new HandlerRequest<>(
			EmptyRequestBody.getInstance(),
			new SavepointStatusMessageParameters(),
			pathParameters,
			Collections.emptyMap());
}
 
Example #10
Source File: RestClusterClient.java    From flink with Apache License 2.0 5 votes vote down vote up
private CompletableFuture<SavepointInfo> pollSavepointAsync(
		final JobID jobId,
		final TriggerId triggerID) {
	return pollResourceAsync(() -> {
		final SavepointStatusHeaders savepointStatusHeaders = SavepointStatusHeaders.getInstance();
		final SavepointStatusMessageParameters savepointStatusMessageParameters =
			savepointStatusHeaders.getUnresolvedMessageParameters();
		savepointStatusMessageParameters.jobIdPathParameter.resolve(jobId);
		savepointStatusMessageParameters.triggerIdPathParameter.resolve(triggerID);
		return sendRequest(
			savepointStatusHeaders,
			savepointStatusMessageParameters);
	});
}
 
Example #11
Source File: RestClusterClientSavepointTriggerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected CompletableFuture<AsynchronousOperationResult<SavepointInfo>> handleRequest(
		@Nonnull HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request,
		@Nonnull DispatcherGateway gateway) throws RestHandlerException {

	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	return CompletableFuture.completedFuture(AsynchronousOperationResult.completed(savepointHandlerLogic.apply(triggerId)));
}
 
Example #12
Source File: SavepointHandlers.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected AsynchronousJobOperationKey getOperationKey(HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request) {
	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	final JobID jobId = request.getPathParameter(JobIDPathParameter.class);
	return AsynchronousJobOperationKey.of(triggerId, jobId);
}
 
Example #13
Source File: SavepointHandlers.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected AsynchronousJobOperationKey getOperationKey(HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request) {
	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	final JobID jobId = request.getPathParameter(JobIDPathParameter.class);
	return AsynchronousJobOperationKey.of(triggerId, jobId);
}
 
Example #14
Source File: SavepointHandlers.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected AsynchronousJobOperationKey getOperationKey(HandlerRequest<EmptyRequestBody, SavepointStatusMessageParameters> request) {
	final TriggerId triggerId = request.getPathParameter(TriggerIdPathParameter.class);
	final JobID jobId = request.getPathParameter(JobIDPathParameter.class);
	return AsynchronousJobOperationKey.of(triggerId, jobId);
}