public class ZooKeeperUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZooKeeperUtils.SecureAclProvider
Secure
ACLProvider implementation. |
static class |
ZooKeeperUtils.ZkClientACLMode
ZooKeeper client ACL mode enum.
|
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,
Executor executor)
Creates a
ZooKeeperCompletedCheckpointStore instance. |
static <T extends Serializable> |
createFileSystemStateStorage(Configuration configuration,
String prefix)
Creates a
FileSystemStateStorageHelper instance. |
static ZooKeeperLeaderElectionService |
createLeaderElectionService(org.apache.curator.framework.CuratorFramework client,
Configuration configuration)
Creates a
ZooKeeperLeaderElectionService instance. |
static ZooKeeperLeaderElectionService |
createLeaderElectionService(org.apache.curator.framework.CuratorFramework client,
Configuration configuration,
String pathSuffix)
Creates a
ZooKeeperLeaderElectionService instance. |
static ZooKeeperLeaderRetrievalService |
createLeaderRetrievalService(org.apache.curator.framework.CuratorFramework client,
Configuration configuration)
Creates a
ZooKeeperLeaderRetrievalService instance. |
static ZooKeeperLeaderRetrievalService |
createLeaderRetrievalService(org.apache.curator.framework.CuratorFramework client,
Configuration configuration,
String pathSuffix)
Creates a
ZooKeeperLeaderRetrievalService instance. |
static ZooKeeperSubmittedJobGraphStore |
createSubmittedJobGraphs(org.apache.curator.framework.CuratorFramework client,
Configuration configuration)
Creates a
ZooKeeperSubmittedJobGraphStore instance. |
static String |
generateZookeeperPath(String root,
String namespace) |
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
HighAvailabilityMode.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)
HighAvailabilityMode.ZOOKEEPER
is configured.public static String getZooKeeperEnsemble(Configuration flinkConf) throws IllegalConfigurationException
IllegalConfigurationException
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService(org.apache.curator.framework.CuratorFramework client, Configuration configuration) throws Exception
ZooKeeperLeaderRetrievalService
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
object containing the configuration valuesZooKeeperLeaderRetrievalService
instance.Exception
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService(org.apache.curator.framework.CuratorFramework client, Configuration configuration, String pathSuffix)
ZooKeeperLeaderRetrievalService
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
object containing the configuration valuespathSuffix
- The path suffix which we want to appendZooKeeperLeaderRetrievalService
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 ZooKeeperLeaderElectionService createLeaderElectionService(org.apache.curator.framework.CuratorFramework client, Configuration configuration, String pathSuffix)
ZooKeeperLeaderElectionService
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
object containing the configuration valuespathSuffix
- The path suffix which we want to appendZooKeeperLeaderElectionService
instance.public static ZooKeeperSubmittedJobGraphStore createSubmittedJobGraphs(org.apache.curator.framework.CuratorFramework client, Configuration configuration) throws Exception
ZooKeeperSubmittedJobGraphStore
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
objectZooKeeperSubmittedJobGraphStore
instanceException
- if the submitted job graph store cannot be createdpublic static CompletedCheckpointStore createCompletedCheckpoints(org.apache.curator.framework.CuratorFramework client, Configuration configuration, JobID jobId, int maxNumberOfCheckpointsToRetain, 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 retainexecutor
- to run ZooKeeper callbacksZooKeeperCompletedCheckpointStore
instanceException
- if the completed checkpoint store cannot be createdpublic static ZooKeeperCheckpointIDCounter createCheckpointIDCounter(org.apache.curator.framework.CuratorFramework client, Configuration configuration, JobID jobId)
ZooKeeperCheckpointIDCounter
instance.client
- The CuratorFramework
ZooKeeper client to useconfiguration
- Configuration
objectjobId
- ID of job to create the instance forZooKeeperCheckpointIDCounter
instancepublic static <T extends Serializable> FileSystemStateStorageHelper<T> createFileSystemStateStorage(Configuration configuration, String prefix) throws IOException
FileSystemStateStorageHelper
instance.T
- Type of the state objectsconfiguration
- Configuration
objectprefix
- Prefix for the created filesFileSystemStateStorageHelper
instanceIOException
- if file system state storage cannot be createdCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.