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.flink.shaded.curator4.org.apache.curator.framework.recipes.cache.PathChildrenCache pathCache)
Submitted job graph store backed by ZooKeeper.
|
Modifier and Type | Method and Description |
---|---|
Collection<JobID> |
getJobIds()
Get all job ids of submitted job graphs to the submitted job graph store.
|
static String |
getPathForJob(JobID jobId)
Returns the JobID as a String (with leading slash).
|
static JobID |
jobIdfromPath(String path)
Returns the JobID from the given path in ZooKeeper.
|
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 ZooKeeperJobGraphStore(String zooKeeperFullBasePath, ZooKeeperStateHandleStore<JobGraph> zooKeeperStateHandleStore, org.apache.flink.shaded.curator4.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
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 static String getPathForJob(JobID jobId)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.