Class ZkDistribStateManager
java.lang.Object
org.apache.solr.client.solrj.impl.ZkDistribStateManager
- All Implemented Interfaces:
Closeable,AutoCloseable,DistribStateManager,org.apache.solr.common.SolrCloseable
Implementation of
DistribStateManager that uses Zookeeper.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createData(String path, byte[] data, org.apache.zookeeper.CreateMode mode) Create data (leaf) node at specified path.org.apache.solr.common.cloud.PerReplicaStatesgetReplicaStates(String path) booleanvoidvoidmakePath(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean failOnExists) List<org.apache.curator.framework.api.transaction.CuratorTransactionResult> voidremoveData(String path, int version) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.client.solrj.cloud.DistribStateManager
getData, getPrsSupplier, listTree, removeRecursivelyMethods inherited from interface org.apache.solr.common.SolrCloseable
isClosed
-
Constructor Details
-
ZkDistribStateManager
-
-
Method Details
-
getJson
public Map<String,Object> getJson(String path) throws InterruptedException, IOException, org.apache.zookeeper.KeeperException - Specified by:
getJsonin interfaceDistribStateManager- Throws:
InterruptedExceptionIOExceptionorg.apache.zookeeper.KeeperException
-
hasData
public boolean hasData(String path) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
hasDatain interfaceDistribStateManager- Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
listData
public List<String> listData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
listDatain interfaceDistribStateManager- Throws:
NoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
listData
public List<String> listData(String path) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
listDatain interfaceDistribStateManager- Throws:
NoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
getData
public VersionedData getData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
getDatain interfaceDistribStateManager- Throws:
NoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
makePath
public void makePath(String path) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
makePathin interfaceDistribStateManager- Throws:
AlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
makePath
public void makePath(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean failOnExists) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
makePathin interfaceDistribStateManager- Throws:
AlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
createData
public 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 interfaceDistribStateManager- 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:
NoSuchElementExceptionAlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
removeData
public void removeData(String path, int version) throws NoSuchElementException, BadVersionException, NotEmptyException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
removeDatain interfaceDistribStateManager- Throws:
NoSuchElementExceptionBadVersionExceptionNotEmptyExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
setData
public void setData(String path, byte[] data, int version) throws BadVersionException, NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
setDatain interfaceDistribStateManager- Throws:
BadVersionExceptionNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
multi
public List<org.apache.curator.framework.api.transaction.CuratorTransactionResult> multi(List<SolrZkClient.CuratorOpBuilder> ops) throws BadVersionException, AlreadyExistsException, NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
multiin interfaceDistribStateManager- Throws:
BadVersionExceptionAlreadyExistsExceptionNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getZkClient
-
getReplicaStates
public org.apache.solr.common.cloud.PerReplicaStates getReplicaStates(String path) throws org.apache.zookeeper.KeeperException, InterruptedException - Specified by:
getReplicaStatesin interfaceDistribStateManager- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-