[
https://issues.apache.org/jira/browse/SOLR-11722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322988#comment-16322988
]
ASF GitHub Bot commented on SOLR-11722:
---------------------------------------
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/304#discussion_r161071815
--- Diff: solr/core/src/java/org/apache/solr/cloud/CreateAliasCmd.java ---
@@ -30,13 +44,101 @@
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
+import org.apache.solr.update.processor.TimeRoutedAliasUpdateProcessor;
+import org.apache.solr.util.DateMathParser;
+import org.apache.solr.util.TimeZoneUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import static java.time.format.DateTimeFormatter.ISO_INSTANT;
+import static
org.apache.solr.cloud.OverseerCollectionMessageHandler.COLL_CONF;
+import static org.apache.solr.common.SolrException.ErrorCode.BAD_REQUEST;
import static org.apache.solr.common.params.CommonParams.NAME;
+import static org.apache.solr.common.params.CommonParams.TZ;
+import static
org.apache.solr.handler.admin.CollectionsHandler.ROUTED_ALIAS_COLLECTION_PROP_PFX;
+import static
org.apache.solr.update.processor.TimeRoutedAliasUpdateProcessor.DATE_TIME_FORMATTER;
public class CreateAliasCmd implements Cmd {
+
+ private static final Logger log =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+ public static final String ROUTING_TYPE = "router.name";
+ public static final String ROUTING_FIELD = "router.field";
+ public static final String ROUTING_INCREMENT = "router.interval";
+ public static final String ROUTING_MAX_FUTURE = "router.max-future-ms";
+ public static final String START = "start";
+ // Collection constants should all reflect names in the v2 structured
input for this command, not v1
+ // names used for CREATE
+ public static final String CREATE_COLLECTION_CONFIG =
"create-collection.config";
--- End diff --
Ugh, all those CREATE_COLLECTION_* constants are a maintenance burden;
surely we can avoid them? I really want to avoid double-specificity of the
collection-creation stuff in any shape or form (not in docs/constants/etc.)
> API to create a Time Routed Alias and first collection
> ------------------------------------------------------
>
> Key: SOLR-11722
> URL: https://issues.apache.org/jira/browse/SOLR-11722
> Project: Solr
> Issue Type: Sub-task
> Security Level: Public(Default Security Level. Issues are Public)
> Components: SolrCloud
> Reporter: David Smiley
> Attachments: SOLR-11722.patch, SOLR-11722.patch
>
>
> This issue is about creating a single API command to create a "Time Routed
> Alias" along with its first collection. Need to decide what endpoint URL it
> is and parameters.
> Perhaps in v2 it'd be {{/api/collections?command=create-routed-alias}} or
> alternatively piggy-back off of command=create-alias but we add more options,
> perhaps with a prefix like "router"?
> Inputs:
> * alias name
> * misc collection creation metadata (e.g. config, numShards, ...) perhaps in
> this context with a prefix like "collection."
> * metadata for TimeRoutedAliasUpdateProcessor, currently: router.field
> * date specifier for first collection; can include "date math".
> We'll certainly add more options as future features unfold.
> I believe the collection needs to be created first (referring to the alias
> name via a core property), and then the alias pointing to it which demands
> collections exist first. When figuring the collection name, you'll need to
> reference the format in TimeRoutedAliasUpdateProcessor.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]