Class AttributeFetcherImpl
- java.lang.Object
-
- org.apache.solr.cluster.placement.impl.AttributeFetcherImpl
-
- All Implemented Interfaces:
AttributeFetcher
public class AttributeFetcherImpl extends Object implements AttributeFetcher
Implementation ofAttributeFetcher
that usesSolrCloudManager
to access Solr cluster details.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeValues
fetchAttributes()
Fetches all requested node attributes from all nodes passed toAttributeFetcher.fetchFrom(Set)
as well as non-node attributes (those requested using e.g.AttributeFetcher
fetchFrom(Set<Node> nodes)
The set of nodes from which to fetch all node related attributes.static String
getMetricSnitchTag(NodeMetric<?> metric)
static String
getSystemPropertySnitchTag(String name)
AttributeFetcher
requestCollectionMetrics(SolrCollection solrCollection, Set<ReplicaMetric<?>> metrics)
Request collection-level metrics.AttributeFetcher
requestNodeMetric(NodeMetric<?> metric)
Request a node metric from each node.AttributeFetcher
requestNodeSystemProperty(String name)
Request a given system property on each node.
-
-
-
Method Detail
-
requestNodeSystemProperty
public AttributeFetcher requestNodeSystemProperty(String name)
Description copied from interface:AttributeFetcher
Request a given system property on each node. To get the value useAttributeValues.getSystemProperty(Node, String)
- Specified by:
requestNodeSystemProperty
in interfaceAttributeFetcher
- Parameters:
name
- system property name
-
requestNodeMetric
public AttributeFetcher requestNodeMetric(NodeMetric<?> metric)
Description copied from interface:AttributeFetcher
Request a node metric from each node. To get the value useAttributeValues.getNodeMetric(Node, NodeMetric)
- Specified by:
requestNodeMetric
in interfaceAttributeFetcher
- Parameters:
metric
- metric to retrieve (seeNodeMetric
)
-
requestCollectionMetrics
public AttributeFetcher requestCollectionMetrics(SolrCollection solrCollection, Set<ReplicaMetric<?>> metrics)
Description copied from interface:AttributeFetcher
Request collection-level metrics. To get the values useAttributeValues.getCollectionMetrics(String)
. Note that this request will fetch information from nodes that are relevant to the collection replicas and not the ones specified inAttributeFetcher.fetchFrom(Set)
(though they may overlap).- Specified by:
requestCollectionMetrics
in interfaceAttributeFetcher
- Parameters:
solrCollection
- request metrics for this collectionmetrics
- metrics to retrieve (seeReplicaMetric
)
-
fetchFrom
public AttributeFetcher fetchFrom(Set<Node> nodes)
Description copied from interface:AttributeFetcher
The set of nodes from which to fetch all node related attributes. Calling this method is mandatory if any of therequestNode*
methods got called.- Specified by:
fetchFrom
in interfaceAttributeFetcher
- Parameters:
nodes
- nodes to fetch from
-
fetchAttributes
public AttributeValues fetchAttributes()
Description copied from interface:AttributeFetcher
Fetches all requested node attributes from all nodes passed toAttributeFetcher.fetchFrom(Set)
as well as non-node attributes (those requested using e.g.AttributeFetcher.requestCollectionMetrics(SolrCollection, Set)
.- Specified by:
fetchAttributes
in interfaceAttributeFetcher
- Returns:
- An instance allowing retrieval of all attributes that could be fetched.
-
getMetricSnitchTag
public static String getMetricSnitchTag(NodeMetric<?> metric)
-
-