diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java index b0e6f442e5f..b89d752e7da 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java @@ -121,7 +121,7 @@ public class CreateAliasCmd implements OverseerCollectionMessageHandler.Cmd { String initialCollectionName = TimeRoutedAlias.formatCollectionNameFromInstant(aliasName, startTime); // Create the collection - RoutedAliasCreateCollectionCmd.createCollectionAndWait(state, aliasName, aliasMetadata, initialCollectionName, ocmh); + MaintainRoutedAliasCmd.createCollectionAndWait(state, aliasName, aliasMetadata, initialCollectionName, ocmh); validateAllCollectionsExistAndNoDups(Collections.singletonList(initialCollectionName), zkStateReader); // Create/update the alias diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAliasCreateCollectionCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java similarity index 97% rename from solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAliasCreateCollectionCmd.java rename to solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java index 2bba70dfb8d..d41a205cc35 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/RoutedAliasCreateCollectionCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java @@ -64,26 +64,25 @@ import static org.apache.solr.common.params.CommonParams.NAME; * @since 7.3 * @lucene.internal */ -// TODO rename class to MaintainRoutedAliasCmd -public class RoutedAliasCreateCollectionCmd implements OverseerCollectionMessageHandler.Cmd { +public class MaintainRoutedAliasCmd implements OverseerCollectionMessageHandler.Cmd { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String IF_MOST_RECENT_COLL_NAME = "ifMostRecentCollName"; //TODO rename to createAfter private final OverseerCollectionMessageHandler ocmh; - public RoutedAliasCreateCollectionCmd(OverseerCollectionMessageHandler ocmh) { + public MaintainRoutedAliasCmd(OverseerCollectionMessageHandler ocmh) { this.ocmh = ocmh; } /** Invokes this command from the client. If there's a problem it will throw an exception. */ public static NamedList remoteInvoke(CollectionsHandler collHandler, String aliasName, String mostRecentCollName) throws Exception { - final String operation = CollectionParams.CollectionAction.ROUTEDALIAS_CREATECOLL.toLower(); + final String operation = CollectionParams.CollectionAction.MAINTAINROUTEDALIAS.toLower(); Map msg = new HashMap<>(); msg.put(Overseer.QUEUE_OPERATION, operation); msg.put(CollectionParams.NAME, aliasName); - msg.put(RoutedAliasCreateCollectionCmd.IF_MOST_RECENT_COLL_NAME, mostRecentCollName); + msg.put(MaintainRoutedAliasCmd.IF_MOST_RECENT_COLL_NAME, mostRecentCollName); final SolrResponse rsp = collHandler.sendToOCPQueue(new ZkNodeProps(msg)); if (rsp.getException() != null) { throw rsp.getException(); diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java index 056f1085763..6519a8e4c91 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java @@ -230,7 +230,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler, .put(CREATEROUTEDALIAS, new CreateAliasCmd(this)) .put(DELETEALIAS, new DeleteAliasCmd(this)) .put(MODIFYALIAS, new ModifyAliasCmd(this)) - .put(ROUTEDALIAS_CREATECOLL, new RoutedAliasCreateCollectionCmd(this)) + .put(MAINTAINROUTEDALIAS, new MaintainRoutedAliasCmd(this)) .put(OVERSEERSTATUS, new OverseerStatusCmd(this)) .put(DELETESHARD, new DeleteShardCmd(this)) .put(DELETEREPLICA, new DeleteReplicaCmd(this)) diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java index 0ffaaa900c4..16529c8114f 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/TimeRoutedAlias.java @@ -51,7 +51,7 @@ import static org.apache.solr.common.params.CommonParams.TZ; * Holds configuration for a routed alias, and some common code and constants. * * @see CreateAliasCmd - * @see RoutedAliasCreateCollectionCmd + * @see MaintainRoutedAliasCmd * @see org.apache.solr.update.processor.TimeRoutedAliasUpdateProcessor */ public class TimeRoutedAlias { diff --git a/solr/core/src/java/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessor.java index cd47c5ce42e..b8ccbd3dbd6 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessor.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.apache.solr.cloud.ZkController; -import org.apache.solr.cloud.api.collections.RoutedAliasCreateCollectionCmd; +import org.apache.solr.cloud.api.collections.MaintainRoutedAliasCmd; import org.apache.solr.cloud.api.collections.TimeRoutedAlias; import org.apache.solr.common.SolrException; import org.apache.solr.common.cloud.Aliases; @@ -275,7 +275,7 @@ public class TimeRoutedAliasUpdateProcessor extends UpdateRequestProcessor { final Semaphore semaphore = aliasToSemaphoreMap.computeIfAbsent(getAliasName(), n -> new Semaphore(1)); if (semaphore.tryAcquire()) { try { - RoutedAliasCreateCollectionCmd.remoteInvoke(collHandler, getAliasName(), mostRecentCollName); + MaintainRoutedAliasCmd.remoteInvoke(collHandler, getAliasName(), mostRecentCollName); // we don't care about the response. It's possible no collection was created because // of a race and that's okay... we'll ultimately retry any way. diff --git a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java index 74fbb95d3ca..d404d60f3c6 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java @@ -80,7 +80,7 @@ public interface CollectionParams { DELETEALIAS(true, LockLevel.COLLECTION), MODIFYALIAS(true, LockLevel.COLLECTION), LISTALIASES(false, LockLevel.NONE), - ROUTEDALIAS_CREATECOLL(true, LockLevel.COLLECTION), + MAINTAINROUTEDALIAS(true, LockLevel.COLLECTION), DELETEROUTEDALIASCOLLECTIONS(true, LockLevel.COLLECTION), SPLITSHARD(true, LockLevel.SHARD), DELETESHARD(true, LockLevel.SHARD),