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.client.solrj.impl.SolrZkClientTimeout.SolrZkClientTimeoutAware,org.apache.solr.common.SolrCloseable
public class ZkClientClusterStateProvider
extends Object
implements org.apache.solr.client.solrj.impl.ClusterStateProvider, org.apache.solr.client.solrj.impl.SolrZkClientTimeout.SolrZkClientTimeoutAware
Retrieves cluster state from Zookeeper
-
Constructor Summary
ConstructorsConstructorDescriptionZkClientClusterStateProvider(String zkHost) ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot) ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot, boolean canUseZkACLs) ZkClientClusterStateProvider(ZkStateReader zkStateReader) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ZkClientClusterStateProviderfrom(org.apache.solr.client.solrj.impl.CloudSolrClient client) Extracts this from the client, or throws an exception if of the wrong type.getAliasProperties(String alias) getClusterProperty(String propertyName) <T> TgetClusterProperty(String propertyName, T def) org.apache.solr.common.cloud.ClusterStateorg.apache.solr.common.cloud.ClusterState.CollectionRefintintbooleanisClosed()resolveAlias(String alias) resolveSimpleAlias(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 mstoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.solr.client.solrj.impl.ClusterStateProvider
getCollection, isRoutedAlias
-
Constructor Details
-
ZkClientClusterStateProvider
-
ZkClientClusterStateProvider
-
ZkClientClusterStateProvider
public ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot, boolean canUseZkACLs) -
ZkClientClusterStateProvider
-
-
Method Details
-
from
public 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. -
getState
- Specified by:
getStatein interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getLiveNodes
- Specified by:
getLiveNodesin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
resolveAlias
- Specified by:
resolveAliasin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getAliasProperties
- Specified by:
getAliasPropertiesin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
resolveSimpleAlias
- Specified by:
resolveSimpleAliasin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider- Throws:
IllegalArgumentException
-
getClusterProperty
- Specified by:
getClusterPropertyin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getClusterProperty
- Specified by:
getClusterPropertyin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getClusterState
public org.apache.solr.common.cloud.ClusterState getClusterState()- Specified by:
getClusterStatein interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getClusterProperties
- Specified by:
getClusterPropertiesin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getPolicyNameByCollection
- Specified by:
getPolicyNameByCollectionin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
getZkStateReader
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getQuorumHosts
- Specified by:
getQuorumHostsin interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider
-
toString
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceorg.apache.solr.common.SolrCloseable
-
getZkHost
- Returns:
- the zkHost value used to connect to zookeeper.
-
getZkConnectTimeout
public int getZkConnectTimeout() -
setZkConnectTimeout
public void setZkConnectTimeout(int zkConnectTimeout) Set the connect timeout to the zookeeper ensemble in ms- Specified by:
setZkConnectTimeoutin interfaceorg.apache.solr.client.solrj.impl.SolrZkClientTimeout.SolrZkClientTimeoutAware
-
getZkClientTimeout
public int getZkClientTimeout() -
setZkClientTimeout
public void setZkClientTimeout(int zkClientTimeout) Set the timeout to the zookeeper ensemble in ms- Specified by:
setZkClientTimeoutin interfaceorg.apache.solr.client.solrj.impl.SolrZkClientTimeout.SolrZkClientTimeoutAware
-
getUrlScheme
- Specified by:
getUrlSchemein interfaceorg.apache.solr.client.solrj.impl.ClusterStateProvider- Returns:
- url scheme with the help of cluster property or environment variable.
-