Package org.apache.solr.common.cloud
Class ZkCmdExecutor
- java.lang.Object
- 
- org.apache.solr.common.cloud.ZkCmdExecutor
 
- 
 public class ZkCmdExecutor extends Object 
- 
- 
Constructor SummaryConstructors 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidensureExists(String path, byte[] data, SolrZkClient zkClient)Create a persistent znode with the given data if it does not already existvoidensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient)Create a znode with the given mode and data if it does not already existvoidensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient, int skipPathParts)Create a node if it does not existvoidensureExists(String path, SolrZkClient zkClient)Create a persistent znode with no data if it does not already existlonggetRetryDelay()protected voidretryDelay(int attemptCount)Performs a retry delay if this is not the first attempt<T> TretryOperation(ZkOperation<T> operation)Perform the given operation, retrying if the connection failsvoidsetRetryDelay(long retryDelay)
 
- 
- 
- 
Constructor Detail- 
ZkCmdExecutorpublic ZkCmdExecutor(int timeoutms) 
 - 
ZkCmdExecutorpublic 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- 
getRetryDelaypublic long getRetryDelay() 
 - 
setRetryDelaypublic void setRetryDelay(long retryDelay) 
 - 
retryOperationpublic <T> T retryOperation(ZkOperation<T> operation) throws org.apache.zookeeper.KeeperException, InterruptedException Perform the given operation, retrying if the connection fails- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
ensureExistspublic void ensureExists(String path, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException Create a persistent znode with no data if it does not already exist- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
- See Also:
- ensureExists(String, byte[], CreateMode, SolrZkClient, int)
 
 - 
ensureExistspublic void ensureExists(String path, byte[] data, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException Create a persistent znode with the given data if it does not already exist- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
- See Also:
- ensureExists(String, byte[], CreateMode, SolrZkClient, int)
 
 - 
ensureExistspublic void ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient) throws org.apache.zookeeper.KeeperException, InterruptedException Create a znode with the given mode and data if it does not already exist- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
- See Also:
- ensureExists(String, byte[], CreateMode, SolrZkClient, int)
 
 - 
ensureExistspublic void ensureExists(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, SolrZkClient zkClient, int skipPathParts) throws org.apache.zookeeper.KeeperException, InterruptedException Create a node if it does not exist- Parameters:
- path- the path at which to create the znode
- data- the optional data to set on the znode
- createMode- the mode with which to create the znode
- zkClient- the client to use to check and create
- skipPathParts- how many path elements to skip
- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
retryDelayprotected void retryDelay(int attemptCount) throws InterruptedExceptionPerforms a retry delay if this is not the first attempt- Parameters:
- attemptCount- the number of the attempts performed so far
- Throws:
- InterruptedException
 
 
- 
 
-