public class ClusterClientJobClientAdapter<ClusterID> extends Object implements JobClient
JobClient
interface that uses a ClusterClient
underneath..Constructor and Description |
---|
ClusterClientJobClientAdapter(ClusterClientProvider<ClusterID> clusterClientProvider,
JobID jobID) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
cancel()
Cancels the associated job.
|
CompletableFuture<Map<String,Object>> |
getAccumulators(ClassLoader classLoader)
Requests the accumulators of the associated job.
|
CompletableFuture<JobExecutionResult> |
getJobExecutionResult(ClassLoader userClassloader)
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 ClusterClientJobClientAdapter(ClusterClientProvider<ClusterID> clusterClientProvider, 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(ClassLoader classLoader)
JobClient
getAccumulators
in interface JobClient
public CompletableFuture<JobExecutionResult> getJobExecutionResult(ClassLoader userClassloader)
JobClient
result of the job execution
of the submitted job.getJobExecutionResult
in interface JobClient
userClassloader
- the classloader used to de-serialize the accumulators of the job.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.