Package org.apache.flink.core.execution
Interface JobClient
-
- All Known Implementing Classes:
ClusterClientJobClientAdapter
,EmbeddedJobClient
,MiniClusterJobClient
,WebSubmissionJobClient
@PublicEvolving public interface JobClient
A client that is scoped to a specific job.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletableFuture<Void>
cancel()
Cancels the associated job.CompletableFuture<Map<String,Object>>
getAccumulators()
Requests the accumulators of the associated job.CompletableFuture<JobExecutionResult>
getJobExecutionResult()
Returns theresult of the job execution
of the submitted job.JobID
getJobID()
Returns theJobID
that uniquely identifies the job this client is scoped to.CompletableFuture<JobStatus>
getJobStatus()
Requests theJobStatus
of the associated job.default void
reportHeartbeat(long expiredTimestamp)
The client reports the heartbeat to the dispatcher for aliveness.CompletableFuture<String>
stopWithSavepoint(boolean advanceToEndOfEventTime, String savepointDirectory, SavepointFormatType formatType)
Stops the associated job on Flink cluster.CompletableFuture<String>
triggerSavepoint(String savepointDirectory, SavepointFormatType formatType)
Triggers a savepoint for the associated job.
-
-
-
Method Detail
-
getJobID
JobID getJobID()
Returns theJobID
that uniquely identifies the job this client is scoped to.
-
getJobStatus
CompletableFuture<JobStatus> getJobStatus()
Requests theJobStatus
of the associated job.
-
cancel
CompletableFuture<Void> cancel()
Cancels the associated job.
-
stopWithSavepoint
CompletableFuture<String> stopWithSavepoint(boolean advanceToEndOfEventTime, @Nullable String savepointDirectory, SavepointFormatType formatType)
Stops the associated job on Flink cluster.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.
- Parameters:
advanceToEndOfEventTime
- flag indicating if the source should inject aMAX_WATERMARK
in the pipelinesavepointDirectory
- directory the savepoint should be written toformatType
- binary format of the savepoint- Returns:
- a
CompletableFuture
containing the path where the savepoint is located
-
triggerSavepoint
CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory, SavepointFormatType formatType)
Triggers a savepoint for the associated job. The savepoint will be written to the given savepoint directory, orCheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.- Parameters:
savepointDirectory
- directory the savepoint should be written toformatType
- binary format of the savepoint- Returns:
- a
CompletableFuture
containing the path where the savepoint is located
-
getAccumulators
CompletableFuture<Map<String,Object>> getAccumulators()
Requests the accumulators of the associated job. Accumulators can be requested while it is running or after it has finished. The class loader is used to deserialize the incoming accumulator results.
-
getJobExecutionResult
CompletableFuture<JobExecutionResult> getJobExecutionResult()
Returns theresult of the job execution
of the submitted job.
-
reportHeartbeat
default void reportHeartbeat(long expiredTimestamp)
The client reports the heartbeat to the dispatcher for aliveness.
-
-