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| 构造器和说明 |
|---|
DefaultJobGraphStore(StateHandleStore<JobGraph,R> stateHandleStore,
JobGraphStoreWatcher jobGraphStoreWatcher,
JobGraphStoreUtil jobGraphStoreUtil) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 JobGraphStoreExceptionpublic void stop()
throws Exception
JobGraphStoreJobGraphStore service.stop 在接口中 JobGraphStoreException@Nullable public JobGraph recoverJobGraph(org.apache.flink.api.common.JobID jobId) throws Exception
JobGraphStorerecoverJobGraph 在接口中 JobGraphStoreExceptionpublic void putJobGraph(JobGraph jobGraph) throws Exception
JobGraphWriterJobGraph instance.
If a job graph with the same JobID exists, it is replaced.
putJobGraph 在接口中 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 在接口中 GloballyCleanableResourceglobalCleanupAsync 在接口中 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 在接口中 LocallyCleanableResourcelocalCleanupAsync 在接口中 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 在接口中 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 在接口中 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 在接口中 JobGraphStore.JobGraphListenerjobId - The JobID of the removed job graphCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.