T
- type of the cluster idpublic interface ClusterClient<T> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Acknowledge> |
cancel(JobID jobId)
Cancels a job identified by the job id.
|
CompletableFuture<String> |
cancelWithSavepoint(JobID jobId,
String savepointDirectory)
Cancels a job identified by the job id and triggers a savepoint.
|
void |
close() |
CompletableFuture<Acknowledge> |
disposeSavepoint(String savepointPath)
Dispose the savepoint under the given path.
|
default CompletableFuture<Map<String,Object>> |
getAccumulators(JobID jobID)
Requests and returns the accumulators for the given job identifier.
|
CompletableFuture<Map<String,Object>> |
getAccumulators(JobID jobID,
ClassLoader loader)
Requests and returns the accumulators for the given job identifier.
|
T |
getClusterId()
Returns the cluster id identifying the cluster to which the client is connected.
|
Configuration |
getFlinkConfiguration()
Return the Flink configuration object.
|
CompletableFuture<JobStatus> |
getJobStatus(JobID jobId)
|
String |
getWebInterfaceURL()
Returns an URL (as a string) to the cluster web interface.
|
CompletableFuture<Collection<JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
CompletableFuture<JobResult> |
requestJobResult(JobID jobId)
|
void |
shutDownCluster()
Shut down the cluster that this client communicate with.
|
CompletableFuture<String> |
stopWithSavepoint(JobID jobId,
boolean advanceToEndOfEventTime,
String savepointDirectory)
Stops a program on Flink cluster whose job-manager is configured in this client's configuration.
|
CompletableFuture<JobID> |
submitJob(JobGraph jobGraph)
Submit the given
JobGraph to the cluster. |
CompletableFuture<String> |
triggerSavepoint(JobID jobId,
String savepointDirectory)
Triggers a savepoint for the job identified by the job id.
|
void close()
close
in interface AutoCloseable
T getClusterId()
Configuration getFlinkConfiguration()
void shutDownCluster()
String getWebInterfaceURL()
CompletableFuture<Collection<JobStatusMessage>> listJobs() throws Exception
Exception
- if no connection to the cluster could be establishedCompletableFuture<Acknowledge> disposeSavepoint(String savepointPath) throws FlinkException
savepointPath
- path to the savepoint to be disposedFlinkException
CompletableFuture<JobID> submitJob(JobGraph jobGraph)
JobGraph
to the cluster.jobGraph
- to submitJobID
of the submitted jobCompletableFuture<JobStatus> getJobStatus(JobID jobId)
CompletableFuture<JobResult> requestJobResult(JobID jobId)
default CompletableFuture<Map<String,Object>> getAccumulators(JobID jobID)
jobID
- The job identifier of a job.CompletableFuture<Map<String,Object>> getAccumulators(JobID jobID, ClassLoader loader)
jobID
- The job identifier of a job.loader
- The class loader for deserializing the accumulator results.CompletableFuture<Acknowledge> cancel(JobID jobId)
jobId
- the job idCompletableFuture<String> cancelWithSavepoint(JobID jobId, @Nullable String savepointDirectory)
jobId
- the job idsavepointDirectory
- directory the savepoint should be written toCompletableFuture<String> stopWithSavepoint(JobID jobId, boolean advanceToEndOfEventTime, @Nullable String savepointDirectory)
jobId
- the job ID of the streaming program to stopadvanceToEndOfEventTime
- 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 locatedCompletableFuture<String> triggerSavepoint(JobID jobId, @Nullable String savepointDirectory)
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.jobId
- job idsavepointDirectory
- directory the savepoint should be written toCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.