You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2020/12/21 11:27:29 UTC

[lucene-solr] branch jira/solr-15019 updated (110325f -> f4b0e40)

This is an automated email from the ASF dual-hosted git repository.

ab pushed a change to branch jira/solr-15019
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 110325f  SOLR-15019: Fix some precommit issues.
     new 7e2ef33  SOLR-15019: Package-private constant.
     new f4b0e40  SOLR-15019: Fix issues from review.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../solr/cluster/placement/AttributeFetcher.java   | 30 +++++++++++++++-------
 .../solr/cluster/placement/AttributeValues.java    |  2 +-
 .../solr/cluster/placement/ReplicaMetric.java      |  4 +--
 .../placement/impl/CollectionMetricsBuilder.java   |  2 +-
 4 files changed, 25 insertions(+), 13 deletions(-)


[lucene-solr] 02/02: SOLR-15019: Fix issues from review.

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-15019
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit f4b0e4087e3f0251b5825a94fee64264c8409397
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Mon Dec 21 12:27:06 2020 +0100

    SOLR-15019: Fix issues from review.
---
 .../solr/cluster/placement/AttributeFetcher.java   | 30 +++++++++++++++-------
 .../solr/cluster/placement/AttributeValues.java    |  2 +-
 .../solr/cluster/placement/ReplicaMetric.java      |  4 +--
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
index 73cba48..af63baa 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
@@ -58,40 +58,48 @@ public interface AttributeFetcher {
 
   /**
    * 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)}
+   * @param metricName name of the metric (within the registry)
+   * @param registry one of the node-level metric registries
    */
   AttributeFetcher requestNodeMetric(String metricName, NodeMetricRegistry registry);
 
   /**
+   * Requests any metric from any metric registry on each node, using a fully-qualified metric key,
+   * for example <code>solr.jvm:system.properties:user.name</code>.
+   * To get the value use {@link AttributeValues#getNodeMetric(Node, String)}
+   * @param metricKey fully-qualified metric key
+   */
+  AttributeFetcher requestNodeMetric(String metricKey);
+
+  /**
    * 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<?>> metricNames);
+  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 any metric from any metric registry on each node, using a fully-qualified metric key,
-   * for example <code>solr.jvm:system.properties:user.name</code>.
-   * To get the value use {@link AttributeValues#getNodeMetric(Node, String)}
-   */
-  AttributeFetcher requestNodeMetric(String metricKey);
-
-  /**
    * 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 #requestNodeMetric(String)}.
    *
@@ -110,7 +118,11 @@ public interface AttributeFetcher {
     /**
      * corresponds to solr.jvm
      */
-    SOLR_JVM
+    SOLR_JVM,
+    /**
+     * corresponds to solr.jetty
+     */
+    SOLR_JETTY
   }
 
   enum DiskHardwareType {
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
index 1f075be..ca0d1b0 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
@@ -74,7 +74,7 @@ public interface AttributeValues {
   Optional<Object> getNodeMetric(Node node, String metricKey);
 
   /**
-   *
+   * Get collection metrics.
    */
   Optional<CollectionMetrics> getCollectionMetrics(String collectionName);
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/ReplicaMetric.java b/solr/core/src/java/org/apache/solr/cluster/placement/ReplicaMetric.java
index b432f6f..0f01889 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/ReplicaMetric.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/ReplicaMetric.java
@@ -28,7 +28,7 @@ public class ReplicaMetric<T> {
 
   private static final double GB = 1024 * 1024 * 1024;
   @SuppressWarnings("unchecked")
-  private final Function<Object, T> NO_CONVERTER = v -> {
+  private final Function<Object, T> IDENTITY_CONVERTER = v -> {
     try {
       return (T) v;
     } catch (ClassCastException cce) {
@@ -71,7 +71,7 @@ public class ReplicaMetric<T> {
     this.name = name;
     this.internalName = internalName;
     if (converter == null) {
-      this.converter = NO_CONVERTER;
+      this.converter = IDENTITY_CONVERTER;
     } else {
       this.converter = converter;
     }


[lucene-solr] 01/02: SOLR-15019: Package-private constant.

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-15019
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 7e2ef33b3476c74c178a67bc92bfabc3d9b4902e
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Thu Dec 17 14:10:09 2020 +0100

    SOLR-15019: Package-private constant.
---
 .../apache/solr/cluster/placement/impl/CollectionMetricsBuilder.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilder.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilder.java
index 6edb930..8c1cb66 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilder.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilder.java
@@ -54,7 +54,7 @@ public class CollectionMetricsBuilder {
       return this;
     }
 
-    public static final String LEADER = "__leader__";
+    static final String LEADER = "__leader__";
 
     public ShardMetrics build() {
       final Map<String, ReplicaMetrics> metricsMap = new HashMap<>();