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<JobID> |
getJobIds()
Get all job ids of submitted job graphs to the submitted job graph store.
|
void |
onAddedJobGraph(JobID jobId)
Callback for
JobGraph instances added by a different JobGraphStore
instance. |
void |
onRemovedJobGraph(JobID jobId)
Callback for
JobGraph instances removed by a different JobGraphStore
instance. |
void |
putJobGraph(JobGraph jobGraph)
Adds the
JobGraph instance. |
JobGraph |
recoverJobGraph(JobID jobId)
|
void |
releaseJobGraph(JobID jobId)
Releases the locks on the specified
JobGraph . |
void |
removeJobGraph(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
JobGraphStore
JobGraphStore
service.start
in interface JobGraphStore
Exception
public void stop() throws Exception
JobGraphStore
JobGraphStore
service.stop
in interface JobGraphStore
Exception
@Nullable public JobGraph recoverJobGraph(JobID jobId) throws Exception
JobGraphStore
recoverJobGraph
in interface JobGraphStore
Exception
public void putJobGraph(JobGraph jobGraph) throws Exception
JobGraphWriter
putJobGraph
in interface JobGraphWriter
Exception
public void removeJobGraph(JobID jobId) throws Exception
JobGraphWriter
removeJobGraph
in interface JobGraphWriter
Exception
public void releaseJobGraph(JobID jobId) throws Exception
JobGraphWriter
JobGraph
.
Releasing the locks allows that another instance can delete the job from the JobGraphStore
.
releaseJobGraph
in interface JobGraphWriter
jobId
- specifying the job to release the locks forException
- if the locks cannot be releasedpublic Collection<JobID> getJobIds() throws Exception
JobGraphStore
getJobIds
in interface JobGraphStore
Exception
- if the operation failspublic void onAddedJobGraph(JobID jobId)
JobGraphStore.JobGraphListener
JobGraph
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.JobGraphListener
jobId
- The JobID
of the added job graphpublic void onRemovedJobGraph(JobID jobId)
JobGraphStore.JobGraphListener
JobGraph
instances removed by a different JobGraphStore
instance.onRemovedJobGraph
in interface JobGraphStore.JobGraphListener
jobId
- The JobID
of the removed job graphCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.