public class ZooKeeperSubmittedJobGraphStore extends Object implements SubmittedJobGraphStore
SubmittedJobGraph instances for JobManagers running in RecoveryMode.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 SubmittedJobGraphListener
to react to such situations.
SubmittedJobGraphStore.SubmittedJobGraphListener| Constructor and Description |
|---|
ZooKeeperSubmittedJobGraphStore(org.apache.curator.framework.CuratorFramework client,
String currentJobsPath,
StateStorageHelper<SubmittedJobGraph> stateStorage)
Submitted job graph store backed by ZooKeeper
|
| Modifier and Type | Method and Description |
|---|---|
static String |
getPathForJob(org.apache.flink.api.common.JobID jobId)
Returns the JobID as a String (with leading slash).
|
void |
putJobGraph(SubmittedJobGraph jobGraph)
Adds the
SubmittedJobGraph instance. |
scala.Option<SubmittedJobGraph> |
recoverJobGraph(org.apache.flink.api.common.JobID jobId)
Returns the
SubmittedJobGraph with the given JobID. |
List<SubmittedJobGraph> |
recoverJobGraphs()
Returns a list of all submitted
JobGraph instances. |
void |
removeJobGraph(org.apache.flink.api.common.JobID jobId)
Removes the
SubmittedJobGraph with the given JobID if it exists. |
void |
start(SubmittedJobGraphStore.SubmittedJobGraphListener jobGraphListener)
Starts the
SubmittedJobGraphStore service. |
void |
stop()
Stops the
SubmittedJobGraphStore service. |
public ZooKeeperSubmittedJobGraphStore(org.apache.curator.framework.CuratorFramework client,
String currentJobsPath,
StateStorageHelper<SubmittedJobGraph> stateStorage)
throws Exception
client - ZooKeeper clientcurrentJobsPath - ZooKeeper path for current job graphsstateStorage - State storage used to persist the submitted jobsExceptionpublic void start(SubmittedJobGraphStore.SubmittedJobGraphListener jobGraphListener) throws Exception
SubmittedJobGraphStoreSubmittedJobGraphStore service.start in interface SubmittedJobGraphStoreExceptionpublic void stop()
throws Exception
SubmittedJobGraphStoreSubmittedJobGraphStore service.stop in interface SubmittedJobGraphStoreExceptionpublic List<SubmittedJobGraph> recoverJobGraphs() throws Exception
SubmittedJobGraphStoreJobGraph instances.recoverJobGraphs in interface SubmittedJobGraphStoreExceptionpublic scala.Option<SubmittedJobGraph> recoverJobGraph(org.apache.flink.api.common.JobID jobId) throws Exception
SubmittedJobGraphStoreSubmittedJobGraph with the given JobID.
An Exception is thrown, if no job graph with the given ID exists.
recoverJobGraph in interface SubmittedJobGraphStoreExceptionpublic void putJobGraph(SubmittedJobGraph jobGraph) throws Exception
SubmittedJobGraphStoreSubmittedJobGraph instance.
If a job graph with the same JobID exists, it is replaced.
putJobGraph in interface SubmittedJobGraphStoreExceptionpublic void removeJobGraph(org.apache.flink.api.common.JobID jobId)
throws Exception
SubmittedJobGraphStoreSubmittedJobGraph with the given JobID if it exists.removeJobGraph in interface SubmittedJobGraphStoreExceptionpublic static String getPathForJob(org.apache.flink.api.common.JobID jobId)
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.