Class ZkDistribStateManager
- java.lang.Object
- 
- org.apache.solr.client.solrj.impl.ZkDistribStateManager
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- DistribStateManager,- org.apache.solr.common.SolrCloseable
 
 public class ZkDistribStateManager extends Object implements DistribStateManager Implementation ofDistribStateManagerthat uses Zookeeper.
- 
- 
Constructor SummaryConstructors Constructor Description ZkDistribStateManager(SolrZkClient zkClient)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()StringcreateData(String path, byte[] data, org.apache.zookeeper.CreateMode mode)Create data (leaf) node at specified path.VersionedDatagetData(String path, org.apache.zookeeper.Watcher watcher)Map<String,Object>getJson(String path)org.apache.solr.common.cloud.PerReplicaStatesgetReplicaStates(String path)SolrZkClientgetZkClient()booleanhasData(String path)List<String>listData(String path)List<String>listData(String path, org.apache.zookeeper.Watcher watcher)voidmakePath(String path)voidmakePath(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean failOnExists)List<org.apache.zookeeper.OpResult>multi(Iterable<org.apache.zookeeper.Op> ops)voidremoveData(String path, int version)voidsetData(String path, byte[] data, int version)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.client.solrj.cloud.DistribStateManagergetData, getPrsSupplier, listTree, removeRecursively
 
- 
 
- 
- 
- 
Constructor Detail- 
ZkDistribStateManagerpublic ZkDistribStateManager(SolrZkClient zkClient) 
 
- 
 - 
Method Detail- 
getJsonpublic Map<String,Object> getJson(String path) throws InterruptedException, IOException, org.apache.zookeeper.KeeperException - Specified by:
- getJsonin interface- DistribStateManager
- Throws:
- InterruptedException
- IOException
- org.apache.zookeeper.KeeperException
 
 - 
hasDatapublic boolean hasData(String path) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- hasDatain interface- DistribStateManager
- Throws:
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
listDatapublic List<String> listData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- listDatain interface- DistribStateManager
- Throws:
- NoSuchElementException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
listDatapublic List<String> listData(String path) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- listDatain interface- DistribStateManager
- Throws:
- NoSuchElementException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
getDatapublic VersionedData getData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- getDatain interface- DistribStateManager
- Throws:
- NoSuchElementException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
makePathpublic void makePath(String path) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- makePathin interface- DistribStateManager
- Throws:
- AlreadyExistsException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
makePathpublic void makePath(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean failOnExists) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- makePathin interface- DistribStateManager
- Throws:
- AlreadyExistsException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
createDatapublic String createData(String path, byte[] data, org.apache.zookeeper.CreateMode mode) throws NoSuchElementException, AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException Description copied from interface:DistribStateManagerCreate data (leaf) node at specified path.- Specified by:
- createDatain interface- DistribStateManager
- Parameters:
- path- base path name of the node.
- data- data to be stored.
- mode- creation mode.
- Returns:
- actual path of the node - in case of sequential nodes this will differ from the base path because of the appended sequence number.
- Throws:
- NoSuchElementException
- AlreadyExistsException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
removeDatapublic void removeData(String path, int version) throws NoSuchElementException, BadVersionException, NotEmptyException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- removeDatain interface- DistribStateManager
- Throws:
- NoSuchElementException
- BadVersionException
- NotEmptyException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
setDatapublic void setData(String path, byte[] data, int version) throws BadVersionException, NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- setDatain interface- DistribStateManager
- Throws:
- BadVersionException
- NoSuchElementException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
multipublic List<org.apache.zookeeper.OpResult> multi(Iterable<org.apache.zookeeper.Op> ops) throws BadVersionException, AlreadyExistsException, NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- multiin interface- DistribStateManager
- Throws:
- BadVersionException
- AlreadyExistsException
- NoSuchElementException
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
getZkClientpublic SolrZkClient getZkClient() 
 - 
getReplicaStatespublic org.apache.solr.common.cloud.PerReplicaStates getReplicaStates(String path) throws org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
- getReplicaStatesin interface- DistribStateManager
- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 
- 
 
-