@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) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
cancel()
Cancels the associated job.
|
CompletableFuture<Map<String,Object>> |
getAccumulators(ClassLoader classLoader)
Requests the accumulators of the associated job.
|
CompletableFuture<JobExecutionResult> |
getJobExecutionResult(ClassLoader userClassloader)
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)
Stops the associated job on Flink cluster.
|
CompletableFuture<String> |
triggerSavepoint(String savepointDirectory)
Triggers a savepoint for the associated job.
|
public EmbeddedJobClient(JobID jobId, DispatcherGateway dispatcherGateway, ScheduledExecutor retryExecutor, Time rpcTimeout)
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)
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 toCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory)
JobClient
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.triggerSavepoint
in interface JobClient
savepointDirectory
- directory the savepoint should be written toCompletableFuture
containing the path where the savepoint is locatedpublic CompletableFuture<Map<String,Object>> getAccumulators(ClassLoader classLoader)
JobClient
getAccumulators
in interface JobClient
public CompletableFuture<JobExecutionResult> getJobExecutionResult(ClassLoader userClassloader)
JobClient
result of the job execution
of the submitted job.getJobExecutionResult
in interface JobClient
userClassloader
- the classloader used to de-serialize the accumulators of the job.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–2021 The Apache Software Foundation. All rights reserved.