public class ZooKeeperJobGraphStore extends Object implements JobGraphStore
JobGraph instances for JobManagers running in HighAvailabilityMode.ZOOKEEPER.
Each job graph creates ZNode:
+----O /flink/jobgraphs/<job-id> 1 [persistent] . . . +----O /flink/jobgraphs/<job-id> N [persistent]
The root path is watched to detect concurrent modifications in corner situations where
multiple instances operate concurrently. The job manager acts as a JobGraphListener
to react to such situations.
JobGraphStore.JobGraphListener| Constructor and Description |
|---|
ZooKeeperJobGraphStore(String zooKeeperFullBasePath,
ZooKeeperStateHandleStore<JobGraph> zooKeeperStateHandleStore,
org.apache.curator.framework.recipes.cache.PathChildrenCache pathCache)
Submitted job graph store backed by ZooKeeper.
|
| 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.
|
static String |
getPathForJob(org.apache.flink.api.common.JobID jobId)
Returns the JobID as a String (with leading slash).
|
static org.apache.flink.api.common.JobID |
jobIdfromPath(String path)
Returns the JobID from the given path in ZooKeeper.
|
void |
putJobGraph(JobGraph jobGraph)
Adds the
JobGraph instance. |
JobGraph |
recoverJobGraph(org.apache.flink.api.common.JobID jobId)
|
void |
releaseJobGraph(org.apache.flink.api.common.JobID jobId)
Releases the locks on the specified
JobGraph. |
void |
removeJobGraph(org.apache.flink.api.common.JobID jobId)
Removes the
JobGraph with the given JobID if it exists. |
void |
start(JobGraphStore.JobGraphListener jobGraphListener)
Starts the
JobGraphStore service. |
void |
stop()
Stops the
JobGraphStore service. |
public ZooKeeperJobGraphStore(String zooKeeperFullBasePath, ZooKeeperStateHandleStore<JobGraph> zooKeeperStateHandleStore, org.apache.curator.framework.recipes.cache.PathChildrenCache pathCache)
zooKeeperFullBasePath - ZooKeeper path for current job graphszooKeeperStateHandleStore - State storage used to persist the submitted jobspublic 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 void removeJobGraph(org.apache.flink.api.common.JobID jobId)
throws Exception
JobGraphWriterJobGraph with the given JobID if it exists.removeJobGraph in interface JobGraphWriterExceptionpublic void releaseJobGraph(org.apache.flink.api.common.JobID jobId)
throws Exception
JobGraphWriterJobGraph.
Releasing the locks allows that another instance can delete the job from
the JobGraphStore.releaseJobGraph in interface JobGraphWriterjobId - specifying the job to release the locks forException - if the locks cannot be releasedpublic Collection<org.apache.flink.api.common.JobID> getJobIds() throws Exception
JobGraphStoregetJobIds in interface JobGraphStoreException - if the operation failspublic static String getPathForJob(org.apache.flink.api.common.JobID jobId)
public static org.apache.flink.api.common.JobID jobIdfromPath(String path)
path - in ZooKeeperCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.