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,
SavepointFormatType formatType)
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.
|
default CompletableFuture<Void> |
invalidateClusterDataset(AbstractID clusterDatasetId)
Invalidate the cached intermediate dataset with the given id.
|
default CompletableFuture<Set<AbstractID>> |
listCompletedClusterDatasetIds()
Return a set of ids of the completed cluster datasets.
|
CompletableFuture<Collection<JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
default CompletableFuture<Void> |
reportHeartbeat(JobID jobId,
long expiredTimestamp)
The client reports the heartbeat to the dispatcher for aliveness.
|
CompletableFuture<JobResult> |
requestJobResult(JobID jobId)
|
CompletableFuture<CoordinationResponse> |
sendCoordinationRequest(JobID jobId,
OperatorID operatorId,
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(JobID jobId,
boolean advanceToEndOfEventTime,
String savepointDirectory,
SavepointFormatType formatType)
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,
SavepointFormatType formatType)
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, SavepointFormatType formatType)
jobId
- the job idsavepointDirectory
- directory the savepoint should be written toformatType
- a binary format of the savepointCompletableFuture<String> stopWithSavepoint(JobID jobId, boolean advanceToEndOfEventTime, @Nullable String savepointDirectory, SavepointFormatType formatType)
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 toformatType
- a binary format of the savepointCompletableFuture
containing the path where the savepoint is locatedCompletableFuture<String> triggerSavepoint(JobID jobId, @Nullable String savepointDirectory, SavepointFormatType formatType)
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.jobId
- job idsavepointDirectory
- directory the savepoint should be written toformatType
- a binary format of the savepointCompletableFuture<CoordinationResponse> sendCoordinationRequest(JobID jobId, OperatorID operatorId, CoordinationRequest request)
jobId
- specifies the job which the coordinator belongs tooperatorId
- specifies which coordinator to receive the requestrequest
- the request to senddefault CompletableFuture<Set<AbstractID>> listCompletedClusterDatasetIds()
default CompletableFuture<Void> invalidateClusterDataset(AbstractID clusterDatasetId)
clusterDatasetId
- id of the cluster dataset to be invalidated.default CompletableFuture<Void> reportHeartbeat(JobID jobId, long expiredTimestamp)
jobId
- The jobId for the client and the job.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.