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

Andrzej Bialecki commented on SOLR-14003:
-----------------------------------------

Please provide also alternatives that don't require passing heavy objects - it 
should be sufficient to pass a set of args that uniquely identify the 
collection / shard, because in some contexts you don't want to create a 
{{Slice}} or {{Replica}} objects just to get a shard leader or a replica state.

{{Replica getLeader(Slice slice, int waitTime);}} should throw a checked 
exception.

> Refactor code to avoid reading state of replica from the data object  
> ----------------------------------------------------------------------
>
>                 Key: SOLR-14003
>                 URL: https://issues.apache.org/jira/browse/SOLR-14003
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Noble Paul
>            Priority: Major
>
> Deprecate
>  * {{Replica#getState()}}
>  * {{Replica#isActive()}}
> Use an implementation of {{ShardStateProvider}} to fetch the state
> {code:java}
> /**An implementation that fetches the state of each replica in a collection
>  * and it also provides the leader of shards
>  *
>  */
> public interface ShardStateProvider {
>   Replica.State getState(Replica replica);
> /**get the leader
> */
>   Replica getLeader(Slice slice);
>  /** Wait if there is no leader available*/
>   Replica getLeader(Slice slice, int waitTime);
>   boolean isActive(Replica replica);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to