lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [lucene-solr] branch jira/solr-14691 updated: SOLR-14691: Fix precommit issues.
Date Wed, 07 Oct 2020 12:54:51 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/jira/solr-14691 by this push:
     new a3df9ec  SOLR-14691: Fix precommit issues.
a3df9ec is described below

commit a3df9ec2ae0b6ab37b01cb04f06059d2dc2c0bdd
Author: Andrzej Bialecki <ab@apache.org>
AuthorDate: Wed Oct 7 14:54:24 2020 +0200

    SOLR-14691: Fix precommit issues.
---
 solr/core/src/java/org/apache/solr/metrics/MetricsMap.java        | 1 +
 solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java    | 7 ++++++-
 .../core/src/test/org/apache/solr/util/stats/MetricUtilsTest.java | 8 ++++----
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java b/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java
index 9566262..8faccff 100644
--- a/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java
+++ b/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java
@@ -70,6 +70,7 @@ public class MetricsMap implements Gauge<Map<String,Object>>,
MapWriter, Dynamic
    * @param mapInitializer function to populate the Map result.
    * @deprecated use {@link #MetricsMap(MapWriter)} instead.
    */
+  @Deprecated(since = "8.7")
   public MetricsMap(BiConsumer<Boolean, Map<String,Object>> mapInitializer) {
     this.mapInitializer = mapInitializer;
   }
diff --git a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
index 28b0f52..1b7b13c 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
@@ -91,8 +91,9 @@ public class MetricUtils {
 
   /**
    * This filter can limit what properties of a metric are returned.
-   * @deprecated use {@link Predicate<CharSequence>} instead.
+   * @deprecated use {@link Predicate} instead.
    */
+  @Deprecated(since = "8.7")
   public interface PropertyFilter {
     PropertyFilter ALL = (name) -> true;
 
@@ -158,6 +159,7 @@ public class MetricUtils {
    * @param consumer consumer that accepts produced {@link SolrInputDocument}-s
    * @deprecated use {@link #toSolrInputDocuments(MetricRegistry, List, MetricFilter, Predicate,
boolean, boolean, boolean, Map, Consumer)} instead.
    */
+  @Deprecated(since = "8.7")
   public static void toSolrInputDocuments(MetricRegistry registry, List<MetricFilter>
shouldMatchFilters,
                                           MetricFilter mustMatchFilter, PropertyFilter propertyFilter,
boolean skipHistograms,
                                           boolean skipAggregateValues, boolean compact,
@@ -261,6 +263,7 @@ public class MetricUtils {
    * @param consumer consumer that accepts produced objects
    * @deprecated use {@link #toMaps(MetricRegistry, List, MetricFilter, Predicate, boolean,
boolean, boolean, boolean, BiConsumer)} instead.
    */
+  @Deprecated(since = "8.7")
   public static void toMaps(MetricRegistry registry, List<MetricFilter> shouldMatchFilters,
                             MetricFilter mustMatchFilter, PropertyFilter propertyFilter,
                             boolean skipHistograms, boolean skipAggregateValues,
@@ -349,6 +352,7 @@ public class MetricUtils {
    * @param consumer consumer that accepts produced objects
    * @deprecated use {@link #convertMetric(String, Metric, Predicate, boolean, boolean, boolean,
boolean, String, BiConsumer)} instead.
    */
+  @Deprecated(since = "8.7")
   public static void convertMetric(String n, Metric metric, PropertyFilter propertyFilter,
boolean skipHistograms, boolean skipAggregateValues,
                                    boolean compact, boolean simple, String separator, BiConsumer<String,
Object> consumer) {
     convertMetric(n, metric, PropertyFilter.toPredicate(propertyFilter),
@@ -523,6 +527,7 @@ public class MetricUtils {
    * @param consumer consumer that accepts produced objects
    * @deprecated use {@link #convertTimer(String, Timer, Predicate, boolean, boolean, String,
BiConsumer)} instead.
    */
+  @Deprecated(since = "8.7")
   public static void convertTimer(String name, Timer timer, PropertyFilter propertyFilter,
boolean skipHistograms,
                                   boolean simple, String separator, BiConsumer<String,
Object> consumer) {
     convertTimer(name, timer, PropertyFilter.toPredicate(propertyFilter),
diff --git a/solr/core/src/test/org/apache/solr/util/stats/MetricUtilsTest.java b/solr/core/src/test/org/apache/solr/util/stats/MetricUtilsTest.java
index 0405727..e95bea4 100644
--- a/solr/core/src/test/org/apache/solr/util/stats/MetricUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/stats/MetricUtilsTest.java
@@ -51,7 +51,7 @@ public class MetricUtilsTest extends SolrTestCaseJ4 {
     }
     // obtain timer metrics
     Map<String,Object> map = new HashMap<>();
-    MetricUtils.convertTimer("", timer, MetricUtils.PropertyFilter.ALL, false, false, ".",
(k, v) -> {
+    MetricUtils.convertTimer("", timer, MetricUtils.ALL_PROPERTIES, false, false, ".", (k,
v) -> {
       ((MapWriter) v).toMap(map);
     });
     @SuppressWarnings({"rawtypes"})
@@ -116,11 +116,11 @@ public class MetricUtilsTest extends SolrTestCaseJ4 {
     });
     registry.register("map", metricsMap);
 
-    SolrMetricManager.GaugeWrapper<MapWriter> gaugeWrapper = new SolrMetricManager.GaugeWrapper(metricsMap,
"foo-tag");
+    SolrMetricManager.GaugeWrapper<Map<String,Object>> gaugeWrapper = new SolrMetricManager.GaugeWrapper<>(metricsMap,
"foo-tag");
     registry.register("wrappedGauge", gaugeWrapper);
 
     MetricUtils.toMaps(registry, Collections.singletonList(MetricFilter.ALL), MetricFilter.ALL,
-        MetricUtils.PropertyFilter.ALL, false, false, false, false, (k, o) -> {
+        MetricUtils.ALL_PROPERTIES, false, false, false, false, (k, o) -> {
       @SuppressWarnings({"rawtypes"})
       Map<String, Object> v = new HashMap<>();
       if (o != null) {
@@ -167,7 +167,7 @@ public class MetricUtilsTest extends SolrTestCaseJ4 {
     });
     // test compact format
     MetricUtils.toMaps(registry, Collections.singletonList(MetricFilter.ALL), MetricFilter.ALL,
-        MetricUtils.PropertyFilter.ALL, false, false, true, false, (k, o) -> {
+        MetricUtils.ALL_PROPERTIES, false, false, true, false, (k, o) -> {
           if (k.startsWith("counter")) {
             assertTrue(o instanceof Long);
             assertEquals(1L, o);


Mime
View raw message