Class SolrClientNodeStateProvider
java.lang.Object
org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,NodeStateProvider,org.apache.solr.common.MapSerializable,org.apache.solr.common.MapWriter,org.apache.solr.common.NavigableObject,org.apache.solr.common.SolrCloseable,org.noggit.JSONWriter.Writable
public class SolrClientNodeStateProvider
extends Object
implements NodeStateProvider, org.apache.solr.common.MapWriter
The real
NodeStateProvider, which communicates with Solr via SolrJ.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
org.apache.solr.common.MapWriter.EntryWriter -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface org.apache.solr.common.MapWriter
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionSolrClientNodeStateProvider(org.apache.solr.client.solrj.impl.CloudSolrClient solrClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()fetchTagValues(String node, Collection<String> tags) voidforEachReplica(String node, Consumer<org.apache.solr.common.cloud.Replica> consumer) static voidforEachReplica(Map<String, Map<String, List<org.apache.solr.common.cloud.Replica>>> collectionVsShardVsReplicas, Consumer<org.apache.solr.common.cloud.Replica> consumer) protected org.apache.solr.client.solrj.impl.ClusterStateProvidergetNodeValues(String node, Collection<String> tags) Get the value of each tag for a given nodegetReplicaInfo(String node, Collection<String> keys) Get the details of each replica in a node.protected voidtoString()voidwriteMap(org.apache.solr.common.MapWriter.EntryWriter ew) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.solr.common.MapWriter
jsonStr, toMap, writeMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _sizeMethods inherited from interface org.apache.solr.common.SolrCloseable
isClosed
-
Field Details
-
nodeVsCollectionVsShardVsReplicaInfo
-
-
Constructor Details
-
SolrClientNodeStateProvider
public SolrClientNodeStateProvider(org.apache.solr.client.solrj.impl.CloudSolrClient solrClient)
-
-
Method Details
-
getClusterStateProvider
protected org.apache.solr.client.solrj.impl.ClusterStateProvider getClusterStateProvider() -
readReplicaDetails
- Throws:
IOException
-
writeMap
- Specified by:
writeMapin interfaceorg.apache.solr.common.MapWriter- Throws:
IOException
-
getNodeValues
Description copied from interface:NodeStateProviderGet the value of each tag for a given node- Specified by:
getNodeValuesin interfaceNodeStateProvider- Parameters:
node- node nametags- tag names- Returns:
- a map of tag vs value
-
fetchTagValues
-
forEachReplica
-
forEachReplica
-
getReplicaInfo
public Map<String,Map<String, getReplicaInfoList<org.apache.solr.common.cloud.Replica>>> (String node, Collection<String> keys) Description copied from interface:NodeStateProviderGet the details of each replica in a node. It attempts to fetch as much details about the replica as mentioned in the keys list. It is not necessary to give all detailsThe format is {collection:shard :[{replicadetails}]}.
- Specified by:
getReplicaInfoin interfaceNodeStateProvider- Returns:
- map of replica infos per collection/shard
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-