Class ZooKeeperConnectionPool
- java.lang.Object
-
- org.apache.manifoldcf.core.lockmanager.ZooKeeperConnectionPool
-
public class ZooKeeperConnectionPool extends java.lang.ObjectPool of ZooKeeper connections. ZooKeeper connections are not trivial to set up and each one carries a cost. Plus, if we want to shut them all down on exit we need them all in one place.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected java.lang.StringconnectStringprotected java.util.List<ZooKeeperConnection>openConnectionListprotected intsessionTimeout
-
Constructor Summary
Constructors Constructor Description ZooKeeperConnectionPool(java.lang.String connectString, int sessionTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAll()ZooKeeperConnectiongrab()voidrelease(ZooKeeperConnection connection)
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
connectString
protected final java.lang.String connectString
-
sessionTimeout
protected final int sessionTimeout
-
openConnectionList
protected final java.util.List<ZooKeeperConnection> openConnectionList
-
-
Method Detail
-
grab
public ZooKeeperConnection grab() throws ManifoldCFException, java.lang.InterruptedException
- Throws:
ManifoldCFExceptionjava.lang.InterruptedException
-
release
public void release(ZooKeeperConnection connection)
-
closeAll
public void closeAll() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
-