Interface ZookeeperFactory

All Known Implementing Classes:
ConfigurableZookeeperFactory, DefaultZookeeperFactory, NonAdminZookeeperFactory

public interface ZookeeperFactory
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.zookeeper.ZooKeeper
    newZooKeeper(String connectString, int sessionTimeout, org.apache.zookeeper.Watcher watcher, boolean canBeReadOnly)
    Allocate a new ZooKeeper instance
    default 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 string
      sessionTimeout - session timeout in milliseconds
      watcher - optional watcher
      canBeReadOnly - if true, allow ZooKeeper client to enter read only mode in case of a network partition. See ZooKeeper(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 string
      sessionTimeout - session timeout in milliseconds
      watcher - optional watcher
      canBeReadOnly - if true, allow ZooKeeper client to enter read only mode in case of a network partition. See ZooKeeper(String, int, Watcher, long, byte[], boolean) for details
      zkClientConfig - ZooKeeper client config
      Returns:
      the instance
      Throws:
      Exception - errors