murblanc commented on a change in pull request #2133: URL: https://github.com/apache/lucene-solr/pull/2133#discussion_r547915021
########## File path: solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java ########## @@ -18,93 +18,53 @@ package org.apache.solr.cluster.placement; import org.apache.solr.cluster.Node; +import org.apache.solr.cluster.SolrCollection; import java.util.Set; /** * <p>Instances of this interface are used to fetch various attributes from nodes (and other sources) in the cluster.</p> */ public interface AttributeFetcher { - /** - * Request the number of cores on each node. To get the value use {@link AttributeValues#getCoresCount(Node)} - */ - AttributeFetcher requestNodeCoreCount(); - - /** - * Request the disk hardware type on each node. To get the value use {@link AttributeValues#getDiskType(Node)} - */ - AttributeFetcher requestNodeDiskType(); - - /** - * Request the free disk size on each node. To get the value use {@link AttributeValues#getFreeDisk(Node)} - */ - AttributeFetcher requestNodeFreeDisk(); - - /** - * Request the total disk size on each node. To get the value use {@link AttributeValues#getTotalDisk(Node)} - */ - AttributeFetcher requestNodeTotalDisk(); - - /** - * Request the heap usage on each node. To get the value use {@link AttributeValues#getHeapUsage(Node)} - */ - AttributeFetcher requestNodeHeapUsage(); - - /** - * Request the system load average on each node. To get the value use {@link AttributeValues#getSystemLoadAverage(Node)} - */ - AttributeFetcher requestNodeSystemLoadAverage(); - /** * Request a given system property on each node. To get the value use {@link AttributeValues#getSystemProperty(Node, String)} + * @param name system property name */ AttributeFetcher requestNodeSystemProperty(String name); /** * Request an environment variable on each node. To get the value use {@link AttributeValues#getEnvironmentVariable(Node, String)} + * @param name environment property name */ AttributeFetcher requestNodeEnvironmentVariable(String name); /** - * Request a node metric from each node. To get the value use {@link AttributeValues#getMetric(Node, String, NodeMetricRegistry)} + * Request a node metric from each node. To get the value use {@link AttributeValues#getNodeMetric(Node, NodeMetric)} + * @param metric metric to retrieve (see {@link NodeMetric}) */ - AttributeFetcher requestNodeMetric(String metricName, NodeMetricRegistry registry); + AttributeFetcher requestNodeMetric(NodeMetric<?> metric); + /** + * Request collection-level metrics. To get the values use {@link AttributeValues#getCollectionMetrics(String)}. + * Note that this request will fetch information from nodes relevant to the collection + * replicas and not the ones specified in {@link #fetchFrom(Set)} (though they may overlap). + * @param solrCollection request metrics for this collection + * @param metrics metrics to retrieve (see {@link ReplicaMetric}) + */ + AttributeFetcher requestCollectionMetrics(SolrCollection solrCollection, Set<ReplicaMetric<?>> metrics); /** * The set of nodes from which to fetch all node related attributes. Calling this method is mandatory if any of the {@code requestNode*} * methods got called. + * @param nodes nodes to fetch from */ AttributeFetcher fetchFrom(Set<Node> nodes); - /** - * Requests a (non node) metric of a given scope and name. To get the value use {@link AttributeValues#getMetric(String, String)} - */ - AttributeFetcher requestMetric(String scope, String metricName); - /** * Fetches all requested node attributes from all nodes passed to {@link #fetchFrom(Set)} as well as non node attributes - * (those requested for example using {@link #requestMetric(String, String)}. + * (those requested for example using {@link #requestNodeMetric(NodeMetric)}. Review comment: Didn't you mean to reference `requestCollectionMetrics` here? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org