Package org.apache.storm.zookeeper
Class Zookeeper
java.lang.Object
org.apache.storm.zookeeper.Zookeeper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.storm.shade.org.apache.zookeeper.server.NIOServerCnxnFactory
mkInprocessZookeeper
(String localdir, Integer port) static void
Resets the singleton instance to the default.static void
Provide an instance of this class for delegates to use.static void
shutdownInprocessZookeeper
(org.apache.storm.shade.org.apache.zookeeper.server.NIOServerCnxnFactory handle) static NimbusInfo
toNimbusInfo
(org.apache.storm.shade.org.apache.curator.framework.recipes.leader.Participant participant) static ILeaderElector
zkLeaderElector
(Map<String, Object> conf, org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zkClient, BlobStore blobStore, TopoCache tc, IStormClusterState clusterState, List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls, StormMetricsRegistry metricsRegistry, Object submitLock) Get master leader elector.protected ILeaderElector
zkLeaderElectorImpl
(Map<String, Object> conf, org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, BlobStore blobStore, TopoCache tc, IStormClusterState clusterState, List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls, StormMetricsRegistry metricsRegistry, Object submitLock)
-
Constructor Details
-
Zookeeper
public Zookeeper()
-
-
Method Details
-
setInstance
Provide an instance of this class for delegates to use. To mock out delegated methods, provide an instance of a subclass that overrides the implementation of the delegated method.- Parameters:
u
- a Zookeeper instance
-
resetInstance
public static void resetInstance()Resets the singleton instance to the default. This is helpful to reset the class to its original functionality when mocking is no longer desired. -
mkInprocessZookeeper
public static org.apache.storm.shade.org.apache.zookeeper.server.NIOServerCnxnFactory mkInprocessZookeeper(String localdir, Integer port) throws Exception - Throws:
Exception
-
shutdownInprocessZookeeper
public static void shutdownInprocessZookeeper(org.apache.storm.shade.org.apache.zookeeper.server.NIOServerCnxnFactory handle) -
toNimbusInfo
public static NimbusInfo toNimbusInfo(org.apache.storm.shade.org.apache.curator.framework.recipes.leader.Participant participant) -
zkLeaderElector
public static ILeaderElector zkLeaderElector(Map<String, Object> conf, org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zkClient, BlobStore blobStore, TopoCache tc, IStormClusterState clusterState, List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls, StormMetricsRegistry metricsRegistry, Object submitLock) Get master leader elector.- Parameters:
conf
- Config.zkClient
- ZkClient, the client must have a default Config.STORM_ZOOKEEPER_ROOT as root path.blobStore
-BlobStore
tc
-TopoCache
clusterState
-IStormClusterState
acls
- ACLs- Returns:
- Instance of
ILeaderElector
-
zkLeaderElectorImpl
protected ILeaderElector zkLeaderElectorImpl(Map<String, Object> conf, org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, BlobStore blobStore, TopoCache tc, IStormClusterState clusterState, List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls, StormMetricsRegistry metricsRegistry, Object submitLock)
-