Class BaseHttpClusterStateProvider
java.lang.Object
org.apache.solr.client.solrj.impl.BaseHttpClusterStateProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterStateProvider,SolrCloseable
- Direct Known Subclasses:
HttpClusterStateProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidconnect()getAliasProperties(String alias) Return alias properties, or an empty map if the alias has no properties.intObtain cluster properties.getClusterProperty(String propertyName) Obtain a cluster property, or null if it doesn't exist.Obtain the current cluster state.getCollection(String collection) Obtain set of live_nodes for the cluster.Get the collection-specific policyprotected abstract SolrClientgetSolrClient(String baseUrl) Create a SolrClient implementation that uses the specified Solr node URLObtain the state of the collection (cluster status).protected voidinitConfiguredNodes(List<String> solrUrls) booleanisClosed()resolveAlias(String aliasName) Given a collection alias, returns a list of collections it points to, or returns a singleton list of the input if it's not an alias.resolveAlias(String aliasName, boolean forceFetch) resolveSimpleAlias(String aliasName) Given a collection alias, return a single collection it points to, or the original name if it's not an alias.Methods 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.impl.ClusterStateProvider
getClusterProperty, isRoutedAlias
-
Field Details
-
SYS_PROP_CACHE_TIMEOUT_SECONDS
- See Also:
-
-
Constructor Details
-
BaseHttpClusterStateProvider
public BaseHttpClusterStateProvider()
-
-
Method Details
-
initConfiguredNodes
- Throws:
Exception
-
connect
public void connect()- Specified by:
connectin interfaceClusterStateProvider
-
getSolrClient
Create a SolrClient implementation that uses the specified Solr node URL -
getCollection
- Specified by:
getCollectionin interfaceClusterStateProvider
-
getState
Description copied from interface:ClusterStateProviderObtain the state of the collection (cluster status).- Specified by:
getStatein interfaceClusterStateProvider- Returns:
- the collection state, or null only if collection doesn't exist
-
getLiveNodes
Description copied from interface:ClusterStateProviderObtain set of live_nodes for the cluster.- Specified by:
getLiveNodesin interfaceClusterStateProvider
-
resolveAlias
Description copied from interface:ClusterStateProviderGiven a collection alias, returns a list of collections it points to, or returns a singleton list of the input if it's not an alias.- Specified by:
resolveAliasin interfaceClusterStateProvider
-
resolveAlias
-
resolveSimpleAlias
Description copied from interface:ClusterStateProviderGiven a collection alias, return a single collection it points to, or the original name if it's not an alias.- Specified by:
resolveSimpleAliasin interfaceClusterStateProvider- Throws:
IllegalArgumentException- if an alias points to more than 1 collection, either directly or indirectly.
-
getAliasProperties
Description copied from interface:ClusterStateProviderReturn alias properties, or an empty map if the alias has no properties.- Specified by:
getAliasPropertiesin interfaceClusterStateProvider
-
getClusterState
Description copied from interface:ClusterStateProviderObtain the current cluster state. WARNING: This method is quite expensive as it involves fetching remote information. Use with caution and be aware of the potential performance implications.- Specified by:
getClusterStatein interfaceClusterStateProvider
-
getClusterProperties
Description copied from interface:ClusterStateProviderObtain cluster properties.- Specified by:
getClusterPropertiesin interfaceClusterStateProvider- Returns:
- configured cluster properties, or an empty map, never null.
-
getPolicyNameByCollection
Description copied from interface:ClusterStateProviderGet the collection-specific policy- Specified by:
getPolicyNameByCollectionin interfaceClusterStateProvider
-
getClusterProperty
Description copied from interface:ClusterStateProviderObtain a cluster property, or null if it doesn't exist.- Specified by:
getClusterPropertyin interfaceClusterStateProvider
-
getCacheTimeout
public int getCacheTimeout() -
getQuorumHosts
- Specified by:
getQuorumHostsin interfaceClusterStateProvider
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceSolrCloseable
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-