Package org.apache.solr.common.cloud
Class ZkCmdExecutor
- java.lang.Object
-
- org.apache.solr.common.cloud.ZkCmdExecutor
-
public class ZkCmdExecutor extends Object
-
-
Constructor Summary
Constructors Constructor Description ZkCmdExecutor(int timeoutms)
ZkCmdExecutor(int timeoutms, ConnectionManager.IsClosed isClosed)
TODO: At this point, this should probably take a SolrZkClient in its constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureExists(String path, byte[] data, SolrZkClient zkClient)
void
ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient)
void
ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient, int skipPathParts)
void
ensureExists(String path, SolrZkClient zkClient)
long
getRetryDelay()
protected void
retryDelay(int attemptCount)
Performs a retry delay if this is not the first attempt<T> T
retryOperation(ZkOperation operation)
Perform the given operation, retrying if the connection failsvoid
setRetryDelay(long retryDelay)
-
-
-
Constructor Detail
-
ZkCmdExecutor
public ZkCmdExecutor(int timeoutms)
-
ZkCmdExecutor
public ZkCmdExecutor(int timeoutms, ConnectionManager.IsClosed isClosed)
TODO: At this point, this should probably take a SolrZkClient in its constructor.- Parameters:
timeoutms
- the client timeout for the ZooKeeper clients that will be used with this class.
-
-
Method Detail
-
getRetryDelay
public long getRetryDelay()
-
setRetryDelay
public void setRetryDelay(long retryDelay)
-
retryOperation
public <T> T retryOperation(ZkOperation operation) throws org.apache.zookeeper.KeeperException, InterruptedException
Perform the given operation, retrying if the connection fails- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
ensureExists
public void ensureExists(String path, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
ensureExists
public void ensureExists(String path, byte[] data, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
ensureExists
public void ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
ensureExists
public void ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient, int skipPathParts) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
retryDelay
protected void retryDelay(int attemptCount) throws InterruptedException
Performs a retry delay if this is not the first attempt- Parameters:
attemptCount
- the number of the attempts performed so far- Throws:
InterruptedException
-
-