Class BaseHttpClusterStateProvider
- java.lang.Object
-
- org.apache.solr.client.solrj.impl.BaseHttpClusterStateProvider
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterStateProvider,SolrCloseable
- Direct Known Subclasses:
Http2ClusterStateProvider,HttpClusterStateProvider
public abstract class BaseHttpClusterStateProvider extends Object implements ClusterStateProvider
-
-
Constructor Summary
Constructors Constructor Description BaseHttpClusterStateProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect()Map<String,String>getAliasProperties(String alias)Return alias properties, or an empty map if the alias has no properties.intgetCacheTimeout()Map<String,Object>getClusterProperties()Obtain cluster properties.ObjectgetClusterProperty(String propertyName)Obtain a cluster property, or null if it doesn't exist.ClusterStategetClusterState()Obtain the current cluster state.Set<String>getLiveNodes()Obtain set of live_nodes for the cluster.StringgetPolicyNameByCollection(String coll)Get the collection-specific policyprotected abstract SolrClientgetSolrClient(String baseUrl)ClusterState.CollectionRefgetState(String collection)Obtain the state of the collection (cluster status).voidinit(List<String> solrUrls)List<String>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.StringresolveSimpleAlias(String aliasName)Given a collection alias, return a single collection it points to, or the original name if it's not an alias.voidsetCacheTimeout(int cacheTimeout)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.client.solrj.impl.ClusterStateProvider
getClusterProperty, getCollection, isRoutedAlias
-
Methods inherited from interface org.apache.solr.common.SolrCloseable
isClosed
-
-
-
-
Method Detail
-
getSolrClient
protected abstract SolrClient getSolrClient(String baseUrl)
-
getState
public ClusterState.CollectionRef getState(String collection)
Description copied from interface:ClusterStateProviderObtain the state of the collection (cluster status).- Specified by:
getStatein interfaceClusterStateProvider- Returns:
- the collection state, or null is collection doesn't exist
-
getLiveNodes
public Set<String> getLiveNodes()
Description copied from interface:ClusterStateProviderObtain set of live_nodes for the cluster.- Specified by:
getLiveNodesin interfaceClusterStateProvider
-
resolveAlias
public List<String> resolveAlias(String aliasName)
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
-
resolveSimpleAlias
public String resolveSimpleAlias(String aliasName) throws IllegalArgumentException
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
public Map<String,String> getAliasProperties(String alias)
Description copied from interface:ClusterStateProviderReturn alias properties, or an empty map if the alias has no properties.- Specified by:
getAliasPropertiesin interfaceClusterStateProvider
-
getClusterState
public ClusterState getClusterState() throws IOException
Description copied from interface:ClusterStateProviderObtain the current cluster state.- Specified by:
getClusterStatein interfaceClusterStateProvider- Throws:
IOException
-
getClusterProperties
public Map<String,Object> getClusterProperties()
Description copied from interface:ClusterStateProviderObtain cluster properties.- Specified by:
getClusterPropertiesin interfaceClusterStateProvider- Returns:
- configured cluster properties, or an empty map, never null.
-
getPolicyNameByCollection
public String getPolicyNameByCollection(String coll)
Description copied from interface:ClusterStateProviderGet the collection-specific policy- Specified by:
getPolicyNameByCollectionin interfaceClusterStateProvider
-
getClusterProperty
public Object getClusterProperty(String propertyName)
Description copied from interface:ClusterStateProviderObtain a cluster property, or null if it doesn't exist.- Specified by:
getClusterPropertyin interfaceClusterStateProvider
-
connect
public void connect()
- Specified by:
connectin interfaceClusterStateProvider
-
getCacheTimeout
public int getCacheTimeout()
-
setCacheTimeout
public void setCacheTimeout(int cacheTimeout)
-
-