public class DefaultJobGraphStore<R extends ResourceVersion<R>> extends Object implements JobGraphStore, JobGraphStore.JobGraphListener
JobGraphStore. Combined with different StateHandleStore, we could persist the job graphs to various distributed storage. Also combined
with different JobGraphStoreWatcher, we could get all the changes on the job graph store
and do the response.JobGraphStore.JobGraphListener| Constructor and Description |
|---|
DefaultJobGraphStore(StateHandleStore<JobGraph,R> stateHandleStore,
JobGraphStoreWatcher jobGraphStoreWatcher,
JobGraphStoreUtil jobGraphStoreUtil) |
| Modifier and Type | Method and Description |
|---|---|
Collection<org.apache.flink.api.common.JobID> |
getJobIds()
Get all job ids of submitted job graphs to the submitted job graph store.
|
CompletableFuture<Void> |
globalCleanupAsync(org.apache.flink.api.common.JobID jobId,
Executor executor)
globalCleanupAsync is expected to be called from the main thread. |
CompletableFuture<Void> |
localCleanupAsync(org.apache.flink.api.common.JobID jobId,
Executor executor)
Releases the locks on the specified
JobGraph. |
void |
onAddedJobGraph(org.apache.flink.api.common.JobID jobId)
Callback for
JobGraph instances added by a different JobGraphStore
instance. |
void |
onRemovedJobGraph(org.apache.flink.api.common.JobID jobId)
Callback for
JobGraph instances removed by a different JobGraphStore
instance. |
void |
putJobGraph(JobGraph jobGraph)
Adds the
JobGraph instance. |
JobGraph |
recoverJobGraph(org.apache.flink.api.common.JobID jobId)
|
void |
start(JobGraphStore.JobGraphListener jobGraphListener)
Starts the
JobGraphStore service. |
void |
stop()
Stops the
JobGraphStore service. |
public DefaultJobGraphStore(StateHandleStore<JobGraph,R> stateHandleStore, JobGraphStoreWatcher jobGraphStoreWatcher, JobGraphStoreUtil jobGraphStoreUtil)
public void start(JobGraphStore.JobGraphListener jobGraphListener) throws Exception
JobGraphStoreJobGraphStore service.start in interface JobGraphStoreExceptionpublic void stop()
throws Exception
JobGraphStoreJobGraphStore service.stop in interface JobGraphStoreException@Nullable public JobGraph recoverJobGraph(org.apache.flink.api.common.JobID jobId) throws Exception
JobGraphStorerecoverJobGraph in interface JobGraphStoreExceptionpublic void putJobGraph(JobGraph jobGraph) throws Exception
JobGraphWriterJobGraph instance.
If a job graph with the same JobID exists, it is replaced.
putJobGraph in interface JobGraphWriterExceptionpublic CompletableFuture<Void> globalCleanupAsync(org.apache.flink.api.common.JobID jobId, Executor executor)
GloballyCleanableResourceglobalCleanupAsync is expected to be called from the main thread. Heavy IO tasks
should be outsourced into the passed cleanupExecutor. Thread-safety must be ensured.globalCleanupAsync in interface GloballyCleanableResourceglobalCleanupAsync in interface JobGraphWriterjobId - The JobID of the job for which the local data should be cleaned up.executor - The fallback executor for IO-heavy operations.public CompletableFuture<Void> localCleanupAsync(org.apache.flink.api.common.JobID jobId, Executor executor)
JobGraph.
Releasing the locks allows that another instance can delete the job from the JobGraphStore.
localCleanupAsync in interface LocallyCleanableResourcelocalCleanupAsync in interface JobGraphWriterjobId - specifying the job to release the locks forexecutor - the executor being used for the asynchronous execution of the local cleanup.public Collection<org.apache.flink.api.common.JobID> getJobIds() throws Exception
JobGraphStoregetJobIds in interface JobGraphStoreException - if the operation failspublic void onAddedJobGraph(org.apache.flink.api.common.JobID jobId)
JobGraphStore.JobGraphListenerJobGraph instances added by a different JobGraphStore
instance.
Important: It is possible to get false positives and be notified about a job graph, which was added by this instance.
onAddedJobGraph in interface JobGraphStore.JobGraphListenerjobId - The JobID of the added job graphpublic void onRemovedJobGraph(org.apache.flink.api.common.JobID jobId)
JobGraphStore.JobGraphListenerJobGraph instances removed by a different JobGraphStore
instance.onRemovedJobGraph in interface JobGraphStore.JobGraphListenerjobId - The JobID of the removed job graphCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.