org.apache.solr.client.solrj.impl

## Class SolrClientDataProvider

- java.lang.Object
- - org.apache.solr.client.solrj.impl.SolrClientDataProvider

All Implemented Interfaces:
  Closeable, AutoCloseable, ClusterDataProvider, MapSerializable, MapWriter

    public class SolrClientDataProvider
    extends Object
    implements ClusterDataProvider, MapWriter

Class that implements `ClusterStateProvider` accepting a SolrClient

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Field Summary

Fields
`AutoScalingConfig` `config`
`static SolrClientDataProvider` `INST`

### Constructor Summary

Constructors
Constructor and Description
`SolrClientDataProvider(CloudSolrClient solrClient)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Collection<String>` `getNodes()`
`Map<String,Object>` `getNodeValues(String node, Collection<String> tags)` Get the value of each tag for a given node
`String` `getPolicyNameByCollection(String coll)` Get the collection-specific policy
`Map<String,Map<String,List<ReplicaInfo>>>` `getReplicaInfo(String node, Collection<String> keys)` Get the details of each replica in a node.
`void` `writeMap(MapWriter.EntryWriter ew)`

### 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.cloud.autoscaling.ClusterDataProvider

`close`

### Methods inherited from interface org.apache.solr.common.MapWriter

`toMap`

### Field Detail

#### INST

    public static SolrClientDataProvider INST

#### config

    public AutoScalingConfig config

### Constructor Detail

#### SolrClientDataProvider

    public SolrClientDataProvider(CloudSolrClient solrClient)

### Method Detail

#### getPolicyNameByCollection

    public String getPolicyNameByCollection(String coll)

Description copied from interface: `ClusterDataProvider`
Get the collection-specific policy

Specified by:
  `getPolicyNameByCollection` in interface `ClusterDataProvider`

#### getNodeValues

    public Map<String,Object> getNodeValues(String node,
                                            Collection<String> tags)

Description copied from interface: `ClusterDataProvider`
Get the value of each tag for a given node

Specified by:
  `getNodeValues` in interface `ClusterDataProvider`
Parameters:
  `node` - node name
  `tags` - tag names
Returns:
  a map of tag vs value

#### getReplicaInfo

    public Map<String,Map<String,List<ReplicaInfo>>> getReplicaInfo(String node,
                                                                    Collection<String> keys)

Description copied from interface: `ClusterDataProvider`
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 al details

the format is {collection:shard :[{replicadetails}]}

Specified by:
  `getReplicaInfo` in interface `ClusterDataProvider`

#### getNodes

    public Collection<String> getNodes()

Specified by:
  `getNodes` in interface `ClusterDataProvider`

#### writeMap

    public void writeMap(MapWriter.EntryWriter ew)
                  throws IOException

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`