[ 
https://issues.apache.org/jira/browse/SOLR-11722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307062#comment-16307062
 ] 

David Smiley commented on SOLR-11722:
-------------------------------------

Hey, excellent progress!  My review follows...

The TZ is only to be used as an argument to DateMathParser's constructor which 
we use when applying the increment.  It is not to be used to format the 
collection names.  If it were, we could have nasty bugs if the TZ were changed 
since it would change the interpretation of preexisting collections.

I disagree that we should check that the routing field exists in the schema.  
Shard routing doesn't, FWIW.

calculateStart() should do little more than 
DateMathParser.parseMath(null,start).  See its javadocs.  It's used all over 
Solr to parse a date (that may but needn't have date math).  To check that 
there are no milliseconds, simply check that the result of 
instant.truncatedTo(ChronoUnit.SECONDS) is equal to the non-truncated version.  
Please avoid GregorianCalendar like the plauge (old API).

In CollectionsHandler, I see you refactored out a parseCollectionCreationProps 
method.  Okay... I can see the point of that as it makes it more concise to 
call this but probably only slightly.  The alternative (which I do in 
SOLR-11653) is to call CollectionOperation.CREATE_OP.execute using a 
LocalSolrRequest wrapper.  What do you think?

I don't quite grok the v2/v1 translation stuff yet; I'll need to look at that 
closer some other day.  But it seems unfortunate that you have to go out of 
your way to make this work just to add some new command, right?  Maybe there is 
an easier way; I don't know.  I guess we can look closer once the patch is more 
ready (i.e. tests).

> 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
>
>
> 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]

Reply via email to