Package org.apache.solr.common.cloud
Class ZkClientConnectionStrategy
- java.lang.Object
-
- org.apache.solr.common.cloud.ZkClientConnectionStrategy
-
- Direct Known Subclasses:
DefaultConnectionStrategy
public abstract class ZkClientConnectionStrategy extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceZkClientConnectionStrategy.ConnectedListenerstatic interfaceZkClientConnectionStrategy.DisconnectedListenerstatic interfaceZkClientConnectionStrategy.ZkUpdate
-
Constructor Summary
Constructors Constructor Description ZkClientConnectionStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddConnectedListener(ZkClientConnectionStrategy.ConnectedListener listener)voidaddDisconnectedListener(ZkClientConnectionStrategy.DisconnectedListener listener)abstract voidconnect(String zkServerAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher, ZkClientConnectionStrategy.ZkUpdate updater)voidconnected()protected org.apache.zookeeper.ZooKeepercreateZooKeeper(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher)voiddisconnected()static ZkClientConnectionStrategyforName(String name, ZkClientConnectionStrategy def)Instantiate a new connection strategy for the given class nameZkCredentialsProvidergetZkCredentialsToAddAutomatically()booleanhasZkCredentialsToAddAutomatically()protected org.apache.zookeeper.ZooKeepernewZooKeeperInstance(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher)abstract voidreconnect(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher, ZkClientConnectionStrategy.ZkUpdate updater)voidremoveDisconnectedListener(ZkClientConnectionStrategy.DisconnectedListener listener)voidsetZkCredentialsToAddAutomatically(ZkCredentialsProvider zkCredentialsToAddAutomatically)
-
-
-
Method Detail
-
connect
public abstract void connect(String zkServerAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher, ZkClientConnectionStrategy.ZkUpdate updater) throws IOException, InterruptedException, TimeoutException
-
reconnect
public abstract void reconnect(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher, ZkClientConnectionStrategy.ZkUpdate updater) throws IOException, InterruptedException, TimeoutException
-
disconnected
public void disconnected()
-
connected
public void connected()
-
addDisconnectedListener
public void addDisconnectedListener(ZkClientConnectionStrategy.DisconnectedListener listener)
-
removeDisconnectedListener
public void removeDisconnectedListener(ZkClientConnectionStrategy.DisconnectedListener listener)
-
addConnectedListener
public void addConnectedListener(ZkClientConnectionStrategy.ConnectedListener listener)
-
setZkCredentialsToAddAutomatically
public void setZkCredentialsToAddAutomatically(ZkCredentialsProvider zkCredentialsToAddAutomatically)
-
hasZkCredentialsToAddAutomatically
public boolean hasZkCredentialsToAddAutomatically()
-
getZkCredentialsToAddAutomatically
public ZkCredentialsProvider getZkCredentialsToAddAutomatically()
-
createZooKeeper
protected org.apache.zookeeper.ZooKeeper createZooKeeper(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher) throws IOException
- Throws:
IOException
-
newZooKeeperInstance
protected org.apache.zookeeper.ZooKeeper newZooKeeperInstance(String serverAddress, int zkClientTimeout, org.apache.zookeeper.Watcher watcher) throws IOException
- Throws:
IOException
-
forName
public static ZkClientConnectionStrategy forName(String name, ZkClientConnectionStrategy def)
Instantiate a new connection strategy for the given class name- Parameters:
name- the name of the strategy to use- Returns:
- the strategy instance, or null if it could not be loaded
-
-