Package org.apache.solr.common.cloud
Class ConnectionManager
- java.lang.Object
-
- org.apache.solr.common.cloud.ConnectionManager
-
- All Implemented Interfaces:
org.apache.zookeeper.Watcher
public class ConnectionManager extends Object implements org.apache.zookeeper.Watcher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConnectionManager.IsClosed
-
Constructor Summary
Constructors Constructor Description ConnectionManager(String name, SolrZkClient client, String zkServerAddress, ZkClientConnectionStrategy strat, OnReconnect onConnect, BeforeReconnect beforeReconnect, ConnectionManager.IsClosed isClosed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isConnected()
boolean
isConnectedAndNotClosed()
boolean
isLikelyExpired()
void
process(org.apache.zookeeper.WatchedEvent event)
void
waitForConnected(long waitForConnection)
Wait for an established zookeeper connectionvoid
waitForDisconnected(long timeout)
void
waitSleep(long waitFor)
-
-
-
Constructor Detail
-
ConnectionManager
public ConnectionManager(String name, SolrZkClient client, String zkServerAddress, ZkClientConnectionStrategy strat, OnReconnect onConnect, BeforeReconnect beforeReconnect, ConnectionManager.IsClosed isClosed)
-
-
Method Detail
-
process
public void process(org.apache.zookeeper.WatchedEvent event)
- Specified by:
process
in interfaceorg.apache.zookeeper.Watcher
-
isConnectedAndNotClosed
public boolean isConnectedAndNotClosed()
-
isConnected
public boolean isConnected()
-
close
public void close()
-
isLikelyExpired
public boolean isLikelyExpired()
-
waitSleep
public void waitSleep(long waitFor)
-
waitForConnected
public void waitForConnected(long waitForConnection) throws TimeoutException
Wait for an established zookeeper connection- Parameters:
waitForConnection
- time to wait, in ms- Throws:
TimeoutException
-
waitForDisconnected
public void waitForDisconnected(long timeout) throws InterruptedException, TimeoutException
- Throws:
InterruptedException
TimeoutException
-
-