public class ClusterClientJobClientAdapter<ClusterID> extends Object implements JobClient, CoordinationRequestGateway
JobClient
interface that uses a ClusterClient
underneath..Constructor and Description |
---|
ClusterClientJobClientAdapter(ClusterClientProvider<ClusterID> clusterClientProvider,
JobID jobID,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
cancel()
Cancels the associated job.
|
CompletableFuture<Map<String,Object>> |
getAccumulators()
Requests the accumulators of the associated job.
|
CompletableFuture<JobExecutionResult> |
getJobExecutionResult()
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. |
void |
reportHeartbeat(long expiredTimestamp)
The client reports the heartbeat to the dispatcher for aliveness.
|
CompletableFuture<CoordinationResponse> |
sendCoordinationRequest(OperatorID operatorId,
CoordinationRequest request)
Send out a request to a specified coordinator and return the response.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
stopWithSavepoint, triggerSavepoint
public ClusterClientJobClientAdapter(ClusterClientProvider<ClusterID> clusterClientProvider, JobID jobID, ClassLoader classLoader)
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, SavepointFormatType formatType)
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 toformatType
- binary format of the savepointCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory, SavepointFormatType formatType)
JobClient
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.triggerSavepoint
in interface JobClient
savepointDirectory
- directory the savepoint should be written toformatType
- binary format of the savepointCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<Map<String,Object>> getAccumulators()
JobClient
getAccumulators
in interface JobClient
public CompletableFuture<JobExecutionResult> getJobExecutionResult()
JobClient
result of the job execution
of the submitted job.getJobExecutionResult
in interface JobClient
public CompletableFuture<CoordinationResponse> sendCoordinationRequest(OperatorID operatorId, CoordinationRequest request)
CoordinationRequestGateway
sendCoordinationRequest
in interface CoordinationRequestGateway
operatorId
- specifies which coordinator to receive the requestrequest
- the request to sendpublic void reportHeartbeat(long expiredTimestamp)
JobClient
reportHeartbeat
in interface JobClient
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.