Class SolrClientNodeStateProvider
- java.lang.Object
-
- org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider
-
- All Implemented Interfaces:
Closeable,AutoCloseable,NodeStateProvider,MapSerializable,MapWriter,NavigableObject,SolrCloseable
public class SolrClientNodeStateProvider extends Object implements NodeStateProvider, MapWriter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Field Summary
Fields Modifier and Type Field Description static SolrClientNodeStateProviderINSTprotected Map<String,Map<String,Map<String,List<ReplicaInfo>>>>nodeVsCollectionVsShardVsReplicaInfo
-
Constructor Summary
Constructors Constructor Description SolrClientNodeStateProvider(CloudSolrClient solrClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected Map<String,Object>fetchReplicaMetrics(String node, Map<String,Pair<String,ReplicaInfo>> metricsKeyVsTagReplica)protected Map<String,Object>fetchTagValues(String node, Collection<String> tags)voidforEachReplica(String node, Consumer<ReplicaInfo> consumer)protected ClusterStateProvidergetClusterStateProvider()Map<String,Object>getNodeValues(String node, Collection<String> tags)Get the value of each tag for a given nodeMap<String,Map<String,List<ReplicaInfo>>>getReplicaInfo(String node, Collection<String> keys)Get the details of each replica in a node.protected voidreadReplicaDetails()StringtoString()voidwriteMap(MapWriter.EntryWriter ew)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
-
Methods inherited from interface org.apache.solr.common.SolrCloseable
isClosed
-
-
-
-
Field Detail
-
INST
public static SolrClientNodeStateProvider INST
-
-
Constructor Detail
-
SolrClientNodeStateProvider
public SolrClientNodeStateProvider(CloudSolrClient solrClient)
-
-
Method Detail
-
getClusterStateProvider
protected ClusterStateProvider getClusterStateProvider()
-
readReplicaDetails
protected void readReplicaDetails() throws IOException- Throws:
IOException
-
writeMap
public void writeMap(MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMapin interfaceMapWriter- Throws:
IOException
-
getNodeValues
public Map<String,Object> getNodeValues(String node, Collection<String> tags)
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
-
forEachReplica
public void forEachReplica(String node, Consumer<ReplicaInfo> consumer)
-
getReplicaInfo
public Map<String,Map<String,List<ReplicaInfo>>> getReplicaInfo(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
-
fetchReplicaMetrics
protected Map<String,Object> fetchReplicaMetrics(String node, Map<String,Pair<String,ReplicaInfo>> metricsKeyVsTagReplica)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-