Class 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.
    • Field Detail

      • nodeVsCollectionVsShardVsReplicaInfo

        protected final Map<String,​Map<String,​Map<String,​List<org.apache.solr.common.cloud.Replica>>>> nodeVsCollectionVsShardVsReplicaInfo
    • Constructor Detail

      • SolrClientNodeStateProvider

        public SolrClientNodeStateProvider​(org.apache.solr.client.solrj.impl.CloudLegacySolrClient solrClient)
    • Method Detail

      • getClusterStateProvider

        protected org.apache.solr.client.solrj.impl.ClusterStateProvider getClusterStateProvider()
      • writeMap

        public void writeMap​(org.apache.solr.common.MapWriter.EntryWriter ew)
                      throws IOException
        Specified by:
        writeMap in interface org.apache.solr.common.MapWriter
        Throws:
        IOException
      • forEachReplica

        public void forEachReplica​(String node,
                                   Consumer<org.apache.solr.common.cloud.Replica> consumer)
      • forEachReplica

        public static void forEachReplica​(Map<String,​Map<String,​List<org.apache.solr.common.cloud.Replica>>> collectionVsShardVsReplicas,
                                          Consumer<org.apache.solr.common.cloud.Replica> consumer)
      • getReplicaInfo

        public Map<String,​Map<String,​List<org.apache.solr.common.cloud.Replica>>> getReplicaInfo​(String node,
                                                                                                             Collection<String> keys)
        Description copied from interface: NodeStateProvider
        Get 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 details

        The format is {collection:shard :[{replicadetails}]}.

        Specified by:
        getReplicaInfo in interface NodeStateProvider
        Returns:
        map of replica infos per collection/shard
      • fetchReplicaMetrics

        protected Map<String,​Object> fetchReplicaMetrics​(String node,
                                                               Map<String,​org.apache.solr.common.util.Pair<String,​org.apache.solr.common.cloud.Replica>> metricsKeyVsTagReplica)