@Internal public class EmbeddedJobClient extends Object implements JobClient, CoordinationRequestGateway
JobClient
with the ability to also submit jobs which uses directly the DispatcherGateway
.Constructor and Description |
---|
EmbeddedJobClient(JobID jobId,
DispatcherGateway dispatcherGateway,
ScheduledExecutor retryExecutor,
Time rpcTimeout,
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. |
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
reportHeartbeat, stopWithSavepoint, triggerSavepoint
public EmbeddedJobClient(JobID jobId, DispatcherGateway dispatcherGateway, ScheduledExecutor retryExecutor, Time rpcTimeout, 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 sendCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.