You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2015/03/30 22:37:53 UTC

[jira] [Commented] (SOLR-7325) Change Slice state into enum

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

Shalin Shekhar Mangar commented on SOLR-7325:
---------------------------------------------

Thanks Shai!

bq. Slice.State declares 4 values: ACTIVE, INACTIVE, CONSTRUCTION, RECOVERY. Are these all the states or did I miss some?

No, those are the only ones we have right now.

bq. I documented these very briefly, mostly from what I understood from the code, and some chats I had w/ Anshum Gupta. I would definitely appreciate a review on this!

Looks good. We can expand on this a bit e.g. a shard in construction or recovery state receives indexing requests from the parent shard leader but does not participate in distributed search.

bq. Backwards-compatibility wise, is it OK if we change Slice.getState() to return the enum? It's an API-break, but I assume it's pretty expert and the migration is really easy.

We can change it to an enum everywhere. These are internal/expert APIs so we have leeway here.

bq. Is it OK to just remove them, or should I deprecate them like I did for STATE?

+1 to just remove them.

> Change Slice state into enum
> ----------------------------
>
>                 Key: SOLR-7325
>                 URL: https://issues.apache.org/jira/browse/SOLR-7325
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Shai Erera
>         Attachments: SOLR-7325.patch
>
>
> Slice state is currently interacted with as a string. It is IMO not trivial to understand which values it can be compared to, in part because the Replica and Slice states are located in different classes, some repeating same constant names and values.
> Also, it's not very clear when does a Slice get into which state and what does that mean.
> I think if it's an enum, and documented briefly in the code, it would help interacting with it through code. I don't mind if we include more extensive documentation in the reference guide / wiki and refer people there for more details.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org