@PublicEvolving public class WebSubmissionJobClient extends Object implements JobClient
JobClient
that only allows asking for the job id of the job it is attached to.
This is used in web submission, where we do not want the Web UI to have jobs blocking threads while waiting for their completion.
Constructor and Description |
---|
WebSubmissionJobClient(JobID jobId) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
cancel()
Cancels the associated job.
|
CompletableFuture<Map<String,Object>> |
getAccumulators()
Requests the accumulators of the associated job.
|
CompletableFuture<JobExecutionResult> |
getJobExecutionResult()
Returns the
result of the job execution of the submitted job. |
JobID |
getJobID()
Returns the
JobID that uniquely identifies the job this client is scoped to. |
CompletableFuture<JobStatus> |
getJobStatus()
Requests the
JobStatus of the associated job. |
CompletableFuture<String> |
stopWithSavepoint(boolean advanceToEndOfEventTime,
String savepointDirectory)
Stops the associated job on Flink cluster.
|
CompletableFuture<String> |
triggerSavepoint(String savepointDirectory)
Triggers a savepoint for the associated job.
|
public WebSubmissionJobClient(JobID jobId)
public JobID getJobID()
JobClient
JobID
that uniquely identifies the job this client is scoped to.public CompletableFuture<JobStatus> getJobStatus()
JobClient
JobStatus
of the associated job.getJobStatus
in interface JobClient
public CompletableFuture<Void> cancel()
JobClient
public CompletableFuture<String> stopWithSavepoint(boolean advanceToEndOfEventTime, @Nullable String savepointDirectory)
JobClient
Stopping works only for streaming programs. Be aware, that the job might continue to run for a while after sending the stop command, because after sources stopped to emit data all operators need to finish processing.
stopWithSavepoint
in interface JobClient
advanceToEndOfEventTime
- flag indicating if the source should inject a MAX_WATERMARK
in the pipelinesavepointDirectory
- directory the savepoint should be written toCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory)
JobClient
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.triggerSavepoint
in interface JobClient
savepointDirectory
- directory the savepoint should be written toCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<Map<String,Object>> getAccumulators()
JobClient
getAccumulators
in interface JobClient
public CompletableFuture<JobExecutionResult> getJobExecutionResult()
JobClient
result of the job execution
of the submitted job.getJobExecutionResult
in interface JobClient
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.