public class ZooKeeperUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ZooKeeperCheckpointIDCounter |
createCheckpointIDCounter(org.apache.curator.framework.CuratorFramework client,
Configuration configuration,
JobID jobId)
Creates a
ZooKeeperCheckpointIDCounter instance. |
static CompletedCheckpointStore |
createCompletedCheckpoints(org.apache.curator.framework.CuratorFramework client,
Configuration configuration,
JobID jobId,
int maxNumberOfCheckpointsToRetain,
ClassLoader userClassLoader,
Executor executor)
Creates a
ZooKeeperCompletedCheckpointStore instance. |
static ZooKeeperLeaderElectionService |
createLeaderElectionService(Configuration configuration)
Creates a
ZooKeeperLeaderElectionService instance and a new CuratorFramework client. |
static ZooKeeperLeaderElectionService |
createLeaderElectionService(org.apache.curator.framework.CuratorFramework client,
Configuration configuration)
Creates a
ZooKeeperLeaderElectionService instance. |
static ZooKeeperLeaderRetrievalService |
createLeaderRetrievalService(Configuration configuration)
Creates a
ZooKeeperLeaderRetrievalService instance. |
static ZooKeeperSubmittedJobGraphStore |
createSubmittedJobGraphs(org.apache.curator.framework.CuratorFramework client,
Configuration configuration,
Executor executor)
Creates a
ZooKeeperSubmittedJobGraphStore instance. |
static String |
getZooKeeperEnsemble(Configuration flinkConf)
Returns the configured ZooKeeper quorum (and removes whitespace, because ZooKeeper does not
tolerate it).
|
static boolean |
isZooKeeperRecoveryMode(Configuration flinkConf)
Returns whether
RecoveryMode.ZOOKEEPER is configured. |
static org.apache.curator.framework.CuratorFramework |
startCuratorFramework(Configuration configuration)
Starts a
CuratorFramework instance and connects it to the given ZooKeeper
quorum. |
public static org.apache.curator.framework.CuratorFramework startCuratorFramework(Configuration configuration)
CuratorFramework
instance and connects it to the given ZooKeeper
quorum.configuration
- Configuration
object containing the configuration valuesCuratorFramework
instancepublic static boolean isZooKeeperRecoveryMode(Configuration flinkConf)
RecoveryMode.ZOOKEEPER
is configured.public static String getZooKeeperEnsemble(Configuration flinkConf) throws IllegalConfigurationException
IllegalConfigurationException
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService(Configuration configuration) throws Exception
ZooKeeperLeaderRetrievalService
instance.configuration
- Configuration
object containing the configuration valuesZooKeeperLeaderRetrievalService
instance.Exception
public static ZooKeeperLeaderElectionService createLeaderElectionService(Configuration configuration) throws Exception
ZooKeeperLeaderElectionService
instance and a new CuratorFramework
client.configuration
- Configuration
object containing the configuration valuesZooKeeperLeaderElectionService
instance.Exception
public static ZooKeeperLeaderElectionService createLeaderElectionService(org.apache.curator.framework.CuratorFramework client, Configuration configuration) throws Exception
ZooKeeperLeaderElectionService
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
object containing the configuration valuesZooKeeperLeaderElectionService
instance.Exception
public static ZooKeeperSubmittedJobGraphStore createSubmittedJobGraphs(org.apache.curator.framework.CuratorFramework client, Configuration configuration, Executor executor) throws Exception
ZooKeeperSubmittedJobGraphStore
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
objectexecutor
- to run ZooKeeper callbacksZooKeeperSubmittedJobGraphStore
instanceException
public static CompletedCheckpointStore createCompletedCheckpoints(org.apache.curator.framework.CuratorFramework client, Configuration configuration, JobID jobId, int maxNumberOfCheckpointsToRetain, ClassLoader userClassLoader, Executor executor) throws Exception
ZooKeeperCompletedCheckpointStore
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
objectjobId
- ID of job to create the instance formaxNumberOfCheckpointsToRetain
- The maximum number of checkpoints to retainuserClassLoader
- User code class loaderexecutor
- to run ZooKeeper callbacksZooKeeperCompletedCheckpointStore
instanceException
public static ZooKeeperCheckpointIDCounter createCheckpointIDCounter(org.apache.curator.framework.CuratorFramework client, Configuration configuration, JobID jobId) throws Exception
ZooKeeperCheckpointIDCounter
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
objectjobId
- ID of job to create the instance forZooKeeperCheckpointIDCounter
instanceException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.