Package org.apache.curator.utils
Interface ZookeeperFactory
- All Known Implementing Classes:
ConfigurableZookeeperFactory
,DefaultZookeeperFactory
,NonAdminZookeeperFactory
public interface ZookeeperFactory
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.zookeeper.ZooKeeper
newZooKeeper
(String connectString, int sessionTimeout, org.apache.zookeeper.Watcher watcher, boolean canBeReadOnly) Allocate a new ZooKeeper instancedefault org.apache.zookeeper.ZooKeeper
newZooKeeper
(String connectString, int sessionTimeout, org.apache.zookeeper.Watcher watcher, boolean canBeReadOnly, org.apache.zookeeper.client.ZKClientConfig zkClientConfig) Allocate a new ZooKeeper instance
-
Method Details
-
newZooKeeper
org.apache.zookeeper.ZooKeeper newZooKeeper(String connectString, int sessionTimeout, org.apache.zookeeper.Watcher watcher, boolean canBeReadOnly) throws Exception Allocate a new ZooKeeper instance- Parameters:
connectString
- the connection stringsessionTimeout
- session timeout in millisecondswatcher
- optional watchercanBeReadOnly
- if true, allow ZooKeeper client to enter read only mode in case of a network partition. SeeZooKeeper(String, int, Watcher, long, byte[], boolean)
for details- Returns:
- the instance
- Throws:
Exception
- errors
-
newZooKeeper
default org.apache.zookeeper.ZooKeeper newZooKeeper(String connectString, int sessionTimeout, org.apache.zookeeper.Watcher watcher, boolean canBeReadOnly, org.apache.zookeeper.client.ZKClientConfig zkClientConfig) throws Exception Allocate a new ZooKeeper instance- Parameters:
connectString
- the connection stringsessionTimeout
- session timeout in millisecondswatcher
- optional watchercanBeReadOnly
- if true, allow ZooKeeper client to enter read only mode in case of a network partition. SeeZooKeeper(String, int, Watcher, long, byte[], boolean)
for detailszkClientConfig
- ZooKeeper client config- Returns:
- the instance
- Throws:
Exception
- errors
-