public class DefaultJobMasterServiceProcess extends Object implements JobMasterServiceProcess, OnCompletionActions
JobMasterServiceProcess
which is responsible for creating and running a JobMasterService
. The process is responsible for receiving the signals from the JobMasterService
and to create the respective JobManagerRunnerResult
from it.
The JobMasterService
can be created asynchronously and the creation can also fail.
That is why the process needs to observe the creation operation and complete the resultFuture
with an initialization failure.
The resultFuture
can be completed with the following values:
JobManagerRunnerResult
to signal an initialization failure of the JobMasterService
or the completion of a job
JobNotFinishedException
to signal that the job has not been completed by the JobMasterService
Exception
to signal an unexpected failure
JobMasterServiceProcess.WaitingForLeadership
Constructor and Description |
---|
DefaultJobMasterServiceProcess(JobID jobId,
UUID leaderSessionId,
JobMasterServiceFactory jobMasterServiceFactory,
Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
closeAsync()
Trigger the closing of the resource and return the corresponding close future.
|
CompletableFuture<JobMasterGateway> |
getJobMasterGatewayFuture()
Future which is completed with the
JobMasterGateway once the JobMasterService
has been created. |
CompletableFuture<String> |
getLeaderAddressFuture()
Future which is completed with the
JobMasterService address once it is created. |
UUID |
getLeaderSessionId()
The leader session id of this process.
|
CompletableFuture<JobManagerRunnerResult> |
getResultFuture()
Future which is completed with the result of job execution.
|
boolean |
isInitializedAndRunning()
True iff the
JobMasterService has been initialized and is running. |
void |
jobMasterFailed(Throwable cause)
The
JobMaster failed while executing the job. |
void |
jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
Job reached a globally terminal state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
waitingForLeadership
close
public DefaultJobMasterServiceProcess(JobID jobId, UUID leaderSessionId, JobMasterServiceFactory jobMasterServiceFactory, Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory)
public CompletableFuture<Void> closeAsync()
AutoCloseableAsync
closeAsync
in interface AutoCloseableAsync
public UUID getLeaderSessionId()
JobMasterServiceProcess
getLeaderSessionId
in interface JobMasterServiceProcess
public boolean isInitializedAndRunning()
JobMasterServiceProcess
JobMasterService
has been initialized and is running.isInitializedAndRunning
in interface JobMasterServiceProcess
public CompletableFuture<JobMasterGateway> getJobMasterGatewayFuture()
JobMasterServiceProcess
JobMasterGateway
once the JobMasterService
has been created. Upon closing of the process, this future is completed exceptionally if it
is still uncompleted.getJobMasterGatewayFuture
in interface JobMasterServiceProcess
public CompletableFuture<JobManagerRunnerResult> getResultFuture()
JobMasterServiceProcess
JobManagerRunnerResult
, JobNotFinishedException
if the job was not finished
or an Throwable
if an unexpected failure occurs. Upon closing of the process, this
future is completed exceptionally with JobNotFinishedException
.getResultFuture
in interface JobMasterServiceProcess
public CompletableFuture<String> getLeaderAddressFuture()
JobMasterServiceProcess
JobMasterService
address once it is created.getLeaderAddressFuture
in interface JobMasterServiceProcess
public void jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
OnCompletionActions
jobReachedGloballyTerminalState
in interface OnCompletionActions
executionGraphInfo
- contains information about the terminated jobpublic void jobMasterFailed(Throwable cause)
OnCompletionActions
JobMaster
failed while executing the job.jobMasterFailed
in interface OnCompletionActions
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.