Interface ClusterStateProvider
- All Superinterfaces:
AutoCloseable,Closeable,SolrCloseable
- All Known Implementing Classes:
BaseHttpClusterStateProvider,DelegatingClusterStateProvider,HttpClusterStateProvider
Provides cluster state from some source
-
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Deprecated.getAliasProperties(String alias) Return alias properties, or an empty map if the alias has no properties.Obtain cluster properties.getClusterProperty(String propertyName) Obtain a cluster property, or null if it doesn't exist.default <T> TgetClusterProperty(String key, T defaultValue) Obtain a cluster property, or the default value if it doesn't exist.Obtain the current cluster state.default DocCollectiongetCollection(String name) Obtain set of live_nodes for the cluster.Get the collection-specific policyObtain the state of the collection (cluster status).default booleanisRoutedAlias(String alias) Returns true if an alias exists and is a routed alias, false otherwise.static ClusterStateProvidernewZkClusterStateProvider(Collection<String> zkHosts, String zkChroot, boolean canUseZkACLs) resolveAlias(String alias) 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.default StringresolveSimpleAlias(String alias) Given a collection alias, return a single collection it points to, or the original name if it's not an alias.Methods inherited from interface org.apache.solr.common.SolrCloseable
isClosed
-
Method Details
-
newZkClusterStateProvider
static ClusterStateProvider newZkClusterStateProvider(Collection<String> zkHosts, String zkChroot, boolean canUseZkACLs) -
getState
Obtain the state of the collection (cluster status).- Returns:
- the collection state, or null only if collection doesn't exist
-
getLiveNodes
Obtain set of live_nodes for the cluster. -
resolveAlias
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. -
getAliasProperties
Return alias properties, or an empty map if the alias has no properties. -
resolveSimpleAlias
Given a collection alias, return a single collection it points to, or the original name if it's not an alias.- Throws:
IllegalArgumentException- if an alias points to more than 1 collection, either directly or indirectly.
-
isRoutedAlias
Returns true if an alias exists and is a routed alias, false otherwise. -
getClusterState
ClusterState getClusterState()Obtain 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. -
getCollection
- Throws:
IOException
-
getClusterProperties
Obtain cluster properties.- Returns:
- configured cluster properties, or an empty map, never null.
-
getClusterProperty
Obtain a cluster property, or the default value if it doesn't exist. -
getClusterProperty
Obtain a cluster property, or null if it doesn't exist. -
getPolicyNameByCollection
Get the collection-specific policy -
connect
Deprecated. -
getQuorumHosts
String getQuorumHosts()
-