Class ZkClientClusterStateProvider
- java.lang.Object
- 
- org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.solr.client.solrj.impl.ClusterStateProvider,- org.apache.solr.common.SolrCloseable
 
 public class ZkClientClusterStateProvider extends Object implements org.apache.solr.client.solrj.impl.ClusterStateProvider Retrieves cluster state from Zookeeper
- 
- 
Constructor SummaryConstructors Constructor Description ZkClientClusterStateProvider(String zkHost)ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot)ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot, boolean canUseZkACLs)ZkClientClusterStateProvider(ZkStateReader zkStateReader)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()voidconnect()static org.apache.solr.common.cloud.ClusterStatecreateFromJsonSupportingLegacyConfigName(int version, byte[] bytes, Set<String> liveNodes, String coll, SolrZkClient zkClient, Instant createTime)Deprecated.static ZkClientClusterStateProviderfrom(org.apache.solr.client.solrj.impl.CloudSolrClient client)Extracts this from the client, or throws an exception if of the wrong type.Map<String,String>getAliasProperties(String alias)Map<String,Object>getClusterProperties()ObjectgetClusterProperty(String propertyName)<T> TgetClusterProperty(String propertyName, T def)org.apache.solr.common.cloud.ClusterStategetClusterState()Set<String>getLiveNodes()StringgetPolicyNameByCollection(String coll)StringgetQuorumHosts()org.apache.solr.common.cloud.ClusterState.CollectionRefgetState(String collection)intgetZkClientTimeout()intgetZkConnectTimeout()StringgetZkHost()ZkStateReadergetZkStateReader()booleanisClosed()List<String>resolveAlias(String alias)StringresolveSimpleAlias(String alias)voidsetZkClientTimeout(int zkClientTimeout)Set the timeout to the zookeeper ensemble in msvoidsetZkConnectTimeout(int zkConnectTimeout)Set the connect timeout to the zookeeper ensemble in msStringtoString()
 
- 
- 
- 
Constructor Detail- 
ZkClientClusterStateProviderpublic ZkClientClusterStateProvider(ZkStateReader zkStateReader) 
 - 
ZkClientClusterStateProviderpublic ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot) 
 - 
ZkClientClusterStateProviderpublic ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot, boolean canUseZkACLs) 
 - 
ZkClientClusterStateProviderpublic ZkClientClusterStateProvider(String zkHost) 
 
- 
 - 
Method Detail- 
frompublic static ZkClientClusterStateProvider from(org.apache.solr.client.solrj.impl.CloudSolrClient client) Extracts this from the client, or throws an exception if of the wrong type.
 - 
createFromJsonSupportingLegacyConfigName@Deprecated public static org.apache.solr.common.cloud.ClusterState createFromJsonSupportingLegacyConfigName(int version, byte[] bytes, Set<String> liveNodes, String coll, SolrZkClient zkClient, Instant createTime) Deprecated.Create a ClusterState from Json. This method supports legacy configName location- Parameters:
- bytes- a byte array of a Json representation of a mapping from collection name to the Json representation of a- DocCollectionas written by- MapWriter.write(JSONWriter). It can represent one or more collections.
- liveNodes- list of live nodes
- coll- collection name
- zkClient- ZK client
- createTime- creation time of the data/bytes
- Returns:
- the ClusterState
 
 - 
getStatepublic org.apache.solr.common.cloud.ClusterState.CollectionRef getState(String collection) - Specified by:
- getStatein interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getLiveNodespublic Set<String> getLiveNodes() - Specified by:
- getLiveNodesin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
resolveAliaspublic List<String> resolveAlias(String alias) - Specified by:
- resolveAliasin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getAliasPropertiespublic Map<String,String> getAliasProperties(String alias) - Specified by:
- getAliasPropertiesin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
resolveSimpleAliaspublic String resolveSimpleAlias(String alias) throws IllegalArgumentException - Specified by:
- resolveSimpleAliasin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
- Throws:
- IllegalArgumentException
 
 - 
getClusterPropertypublic Object getClusterProperty(String propertyName) - Specified by:
- getClusterPropertyin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getClusterPropertypublic <T> T getClusterProperty(String propertyName, T def) - Specified by:
- getClusterPropertyin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getClusterStatepublic org.apache.solr.common.cloud.ClusterState getClusterState() - Specified by:
- getClusterStatein interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getClusterPropertiespublic Map<String,Object> getClusterProperties() - Specified by:
- getClusterPropertiesin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getPolicyNameByCollectionpublic String getPolicyNameByCollection(String coll) - Specified by:
- getPolicyNameByCollectionin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
connectpublic void connect() - Specified by:
- connectin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
getZkStateReaderpublic ZkStateReader getZkStateReader() 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
getQuorumHostspublic String getQuorumHosts() - Specified by:
- getQuorumHostsin interface- org.apache.solr.client.solrj.impl.ClusterStateProvider
 
 - 
isClosedpublic boolean isClosed() - Specified by:
- isClosedin interface- org.apache.solr.common.SolrCloseable
 
 - 
getZkHostpublic String getZkHost() - Returns:
- the zkHost value used to connect to zookeeper.
 
 - 
getZkConnectTimeoutpublic int getZkConnectTimeout() 
 - 
setZkConnectTimeoutpublic void setZkConnectTimeout(int zkConnectTimeout) Set the connect timeout to the zookeeper ensemble in ms
 - 
getZkClientTimeoutpublic int getZkClientTimeout() 
 - 
setZkClientTimeoutpublic void setZkClientTimeout(int zkClientTimeout) Set the timeout to the zookeeper ensemble in ms
 
- 
 
-