lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [lucene-solr] 01/02: SOLR-15055: Add javadocs + fix precommit.
Date Wed, 20 Jan 2021 14:25:16 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 301a0ee680b480dbaea6f32589d79b4ce407c844
Author: Andrzej Bialecki <ab@apache.org>
AuthorDate: Wed Jan 20 15:23:47 2021 +0100

    SOLR-15055: Add javadocs + fix precommit.
---
 .../java/org/apache/solr/cloud/api/collections/Assign.java   |  1 -
 .../solr/cluster/placement/DeleteCollectionRequest.java      |  2 +-
 .../apache/solr/cluster/placement/DeleteReplicasRequest.java |  2 +-
 .../apache/solr/cluster/placement/DeleteShardsRequest.java   |  2 +-
 .../apache/solr/cluster/placement/ModificationRequest.java   |  2 +-
 .../org/apache/solr/cluster/placement/PlacementContext.java  |  2 +-
 .../cluster/placement/PlacementModificationException.java    | 12 +++++++++++-
 .../solr/cluster/placement/impl/ModificationRequestImpl.java |  1 -
 .../solr/cluster/placement/impl/ReplicaMetricImpl.java       |  3 +++
 .../cluster/placement/impl/SimplePlacementContextImpl.java   |  3 ++-
 .../placement/plugins/MinimizeCoresPlacementFactory.java     |  1 -
 .../cluster/placement/plugins/RandomPlacementFactory.java    |  1 -
 .../placement/plugins/AffinityPlacementFactoryTest.java      |  1 -
 13 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java
index d0d1f88..3c40d46 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java
@@ -40,7 +40,6 @@ import org.apache.solr.client.solrj.cloud.SolrCloudManager;
 import org.apache.solr.client.solrj.cloud.AlreadyExistsException;
 import org.apache.solr.client.solrj.cloud.BadVersionException;
 import org.apache.solr.client.solrj.cloud.VersionedData;
-import org.apache.solr.cluster.placement.ModificationRequest;
 import org.apache.solr.cluster.placement.PlacementPlugin;
 import org.apache.solr.cluster.placement.impl.PlacementPluginAssignStrategy;
 import org.apache.solr.common.SolrException;
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteCollectionRequest.java
b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteCollectionRequest.java
index b5dabc5..fdd3f8b 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteCollectionRequest.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteCollectionRequest.java
@@ -17,7 +17,7 @@
 package org.apache.solr.cluster.placement;
 
 /**
- *
+ * Delete collection request.
  */
 public interface DeleteCollectionRequest extends ModificationRequest {
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteReplicasRequest.java
b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteReplicasRequest.java
index 09f5762..3ce755d 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteReplicasRequest.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteReplicasRequest.java
@@ -22,7 +22,7 @@ import org.apache.solr.cluster.Replica;
 import java.util.Set;
 
 /**
- *
+ * Delete replicas request.
  */
 public interface DeleteReplicasRequest extends ModificationRequest {
   Set<Replica> getReplicas();
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteShardsRequest.java
b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteShardsRequest.java
index 5bff54f..3638223 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/DeleteShardsRequest.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/DeleteShardsRequest.java
@@ -20,7 +20,7 @@ package org.apache.solr.cluster.placement;
 import java.util.Set;
 
 /**
- *
+ * Delete shards request.
  */
 public interface DeleteShardsRequest extends ModificationRequest {
   Set<String> getShardNames();
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/ModificationRequest.java
b/solr/core/src/java/org/apache/solr/cluster/placement/ModificationRequest.java
index 964d9bf..4aed2ba 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/ModificationRequest.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/ModificationRequest.java
@@ -20,7 +20,7 @@ package org.apache.solr.cluster.placement;
 import org.apache.solr.cluster.SolrCollection;
 
 /**
- *
+ * Collection modification request.
  */
 public interface ModificationRequest {
   /**
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementContext.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementContext.java
index 89deecd..617f6f6 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementContext.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementContext.java
@@ -20,7 +20,7 @@ package org.apache.solr.cluster.placement;
 import org.apache.solr.cluster.Cluster;
 
 /**
- *
+ * Placement context makes it easier to pass around and access main placement-related components.
  */
 public interface PlacementContext {
   /**
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementModificationException.java
b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementModificationException.java
index 19a7dd7..d9162e1 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementModificationException.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementModificationException.java
@@ -4,7 +4,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- *
+ * Exception thrown when a placement modification is rejected by the placement plugin.
+ * Additional details about the reasons are provided if available
+ * in {@link #getRejectedModifications()} or in the {@link #toString()} methods.
  */
 public class PlacementModificationException extends PlacementException {
   private final Map<String, String> rejectedModifications = new HashMap<>();
@@ -25,10 +27,18 @@ public class PlacementModificationException extends PlacementException
{
     super(cause);
   }
 
+  /**
+   * Add information about the modification that cause this exception.
+   * @param modification requested modification details
+   * @param reason reason for rejection
+   */
   public void addRejectedModification(String modification, String reason) {
     rejectedModifications.put(modification, reason);
   }
 
+  /**
+   * Return rejected modifications and reasons for rejections.
+   */
   public Map<String, String> getRejectedModifications() {
     return rejectedModifications;
   }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ModificationRequestImpl.java
b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ModificationRequestImpl.java
index f6889d2..7daff45 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ModificationRequestImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ModificationRequestImpl.java
@@ -69,7 +69,6 @@ public class ModificationRequestImpl {
    * @param docCollection Solr collection
    * @param shardName shard name
    * @param replicaNames replica names (aka. core-node names)
-   * @return
    */
   public static DeleteReplicasRequest deleteReplicasRequest(DocCollection docCollection,
String shardName, Set<String> replicaNames) {
     SolrCollection solrCollection = SimpleClusterAbstractionsImpl.SolrCollectionImpl.fromDocCollection(docCollection);
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
index f793a64..1d822b2 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
@@ -26,9 +26,12 @@ import java.util.function.Function;
  */
 public class ReplicaMetricImpl<T> extends MetricImpl<T> implements ReplicaMetric<T>
{
 
+  /** Replica index size in GB. */
   public static final ReplicaMetricImpl<Double> INDEX_SIZE_GB = new ReplicaMetricImpl<>("sizeGB",
"INDEX.sizeInBytes", BYTES_TO_GB_CONVERTER);
 
+  /** 1-min query rate of the /select handler. */
   public static final ReplicaMetricImpl<Double> QUERY_RATE_1MIN = new ReplicaMetricImpl<>("queryRate",
"QUERY./select.requestTimes:1minRate");
+  /** 1-min update rate of the /update handler. */
   public static final ReplicaMetricImpl<Double> UPDATE_RATE_1MIN = new ReplicaMetricImpl<>("updateRate",
"UPDATE./update.requestTimes:1minRate");
 
   public ReplicaMetricImpl(String name, String internalName) {
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimplePlacementContextImpl.java
b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimplePlacementContextImpl.java
index c04812c..6850a95 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimplePlacementContextImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimplePlacementContextImpl.java
@@ -9,7 +9,8 @@ import org.apache.solr.cluster.placement.PlacementPlanFactory;
 import java.io.IOException;
 
 /**
- *
+ * Implementation of {@link PlacementContext} that uses {@link SimpleClusterAbstractionsImpl}
+ * to create components necessary for the placement plugins to use.
  */
 public class SimplePlacementContextImpl implements PlacementContext {
 
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/MinimizeCoresPlacementFactory.java
b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/MinimizeCoresPlacementFactory.java
index b28b518..c26b08d 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/MinimizeCoresPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/MinimizeCoresPlacementFactory.java
@@ -26,7 +26,6 @@ import java.util.Map;
 
 import com.google.common.collect.Ordering;
 import com.google.common.collect.TreeMultimap;
-import org.apache.solr.cluster.Cluster;
 import org.apache.solr.cluster.Node;
 import org.apache.solr.cluster.Replica;
 import org.apache.solr.cluster.SolrCollection;
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/RandomPlacementFactory.java
b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/RandomPlacementFactory.java
index 3043d2c..aec0893 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/RandomPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/RandomPlacementFactory.java
@@ -23,7 +23,6 @@ import java.util.HashSet;
 import java.util.Random;
 import java.util.Set;
 
-import org.apache.solr.cluster.Cluster;
 import org.apache.solr.cluster.Node;
 import org.apache.solr.cluster.Replica;
 import org.apache.solr.cluster.SolrCollection;
diff --git a/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
b/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
index b0e28aa..e9478a4 100644
--- a/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
@@ -26,7 +26,6 @@ import org.apache.solr.cluster.SolrCollection;
 import org.apache.solr.cluster.placement.*;
 import org.apache.solr.cluster.placement.Builders;
 import org.apache.solr.cluster.placement.impl.ModificationRequestImpl;
-import org.apache.solr.cluster.placement.impl.PlacementPlanFactoryImpl;
 import org.apache.solr.cluster.placement.impl.PlacementRequestImpl;
 import org.apache.solr.common.util.Pair;
 import org.junit.BeforeClass;


Mime
View raw message