T - type of the cluster idpublic interface ClusterClient<T> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> |
cancel(org.apache.flink.api.common.JobID jobId)
Cancels a job identified by the job id.
|
CompletableFuture<String> |
cancelWithSavepoint(org.apache.flink.api.common.JobID jobId,
String savepointDirectory)
Cancels a job identified by the job id and triggers a savepoint.
|
void |
close() |
CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> |
disposeSavepoint(String savepointPath)
Dispose the savepoint under the given path.
|
default CompletableFuture<Map<String,Object>> |
getAccumulators(org.apache.flink.api.common.JobID jobID)
Requests and returns the accumulators for the given job identifier.
|
CompletableFuture<Map<String,Object>> |
getAccumulators(org.apache.flink.api.common.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.
|
org.apache.flink.configuration.Configuration |
getFlinkConfiguration()
Return the Flink configuration object.
|
CompletableFuture<org.apache.flink.api.common.JobStatus> |
getJobStatus(org.apache.flink.api.common.JobID jobId)
Requests the
JobStatus of the job with the given JobID. |
String |
getWebInterfaceURL()
Returns an URL (as a string) to the cluster web interface.
|
CompletableFuture<Collection<org.apache.flink.runtime.client.JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> |
requestJobResult(org.apache.flink.api.common.JobID jobId)
Request the
JobResult for the given JobID. |
CompletableFuture<org.apache.flink.runtime.operators.coordination.CoordinationResponse> |
sendCoordinationRequest(org.apache.flink.api.common.JobID jobId,
org.apache.flink.runtime.jobgraph.OperatorID operatorId,
org.apache.flink.runtime.operators.coordination.CoordinationRequest request)
Sends out a request to a specified coordinator and return the response.
|
void |
shutDownCluster()
Shut down the cluster that this client communicate with.
|
CompletableFuture<String> |
stopWithSavepoint(org.apache.flink.api.common.JobID jobId,
boolean advanceToEndOfEventTime,
String savepointDirectory)
Stops a program on Flink cluster whose job-manager is configured in this client's
configuration.
|
CompletableFuture<org.apache.flink.api.common.JobID> |
submitJob(org.apache.flink.runtime.jobgraph.JobGraph jobGraph)
Submit the given
JobGraph to the cluster. |
CompletableFuture<String> |
triggerSavepoint(org.apache.flink.api.common.JobID jobId,
String savepointDirectory)
Triggers a savepoint for the job identified by the job id.
|
void close()
close in interface AutoCloseableT getClusterId()
org.apache.flink.configuration.Configuration getFlinkConfiguration()
void shutDownCluster()
String getWebInterfaceURL()
CompletableFuture<Collection<org.apache.flink.runtime.client.JobStatusMessage>> listJobs() throws Exception
Exception - if no connection to the cluster could be establishedCompletableFuture<org.apache.flink.runtime.messages.Acknowledge> disposeSavepoint(String savepointPath) throws org.apache.flink.util.FlinkException
savepointPath - path to the savepoint to be disposedorg.apache.flink.util.FlinkExceptionCompletableFuture<org.apache.flink.api.common.JobID> submitJob(org.apache.flink.runtime.jobgraph.JobGraph jobGraph)
JobGraph to the cluster.jobGraph - to submitJobID of the submitted jobCompletableFuture<org.apache.flink.api.common.JobStatus> getJobStatus(org.apache.flink.api.common.JobID jobId)
JobStatus of the job with the given JobID.CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> requestJobResult(org.apache.flink.api.common.JobID jobId)
JobResult for the given JobID.jobId - for which to request the JobResultJobResultdefault CompletableFuture<Map<String,Object>> getAccumulators(org.apache.flink.api.common.JobID jobID)
jobID - The job identifier of a job.CompletableFuture<Map<String,Object>> getAccumulators(org.apache.flink.api.common.JobID jobID, ClassLoader loader)
jobID - The job identifier of a job.loader - The class loader for deserializing the accumulator results.CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> cancel(org.apache.flink.api.common.JobID jobId)
jobId - the job idCompletableFuture<String> cancelWithSavepoint(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory)
jobId - the job idsavepointDirectory - directory the savepoint should be written toCompletableFuture<String> stopWithSavepoint(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory)
CheckpointingOptions.SAVEPOINT_DIRECTORY if it is null.jobId - job idsavepointDirectory - directory the savepoint should be written toCompletableFuture<org.apache.flink.runtime.operators.coordination.CoordinationResponse> sendCoordinationRequest(org.apache.flink.api.common.JobID jobId, org.apache.flink.runtime.jobgraph.OperatorID operatorId, org.apache.flink.runtime.operators.coordination.CoordinationRequest request)
jobId - specifies the job which the coordinator belongs tooperatorId - specifies which coordinator to receive the requestrequest - the request to sendCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.