lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shalin Shekhar Mangar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-12817) Simply response processing in CreateShardCmd
Date Wed, 03 Oct 2018 08:19:00 GMT

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

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

[~ab] - I changed that SOLR-9317. Once Add Replica is able to create more than 1 replica at
a time, there is no reason for create shard to assign nodes and call add replica one by one
for each replica of that shard. Is there a reason why we should preserve the old behavior?

> Simply response processing in CreateShardCmd
> --------------------------------------------
>
>                 Key: SOLR-12817
>                 URL: https://issues.apache.org/jira/browse/SOLR-12817
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Varun Thacker
>            Priority: Major
>
> While working on SOLR-12708 , Mano disccovered used the response parsing technique from
CreateShardCmd
> {code:java}
> final NamedList addResult = new NamedList();
> try {
>   ocmh.addReplica(zkStateReader.getClusterState(), addReplicasProps, addResult, () ->
{
>     Object addResultFailure = addResult.get("failure");
>     if (addResultFailure != null) {
>       SimpleOrderedMap failure = (SimpleOrderedMap) results.get("failure");
>       if (failure == null) {
>         failure = new SimpleOrderedMap();
>         results.add("failure", failure);
>       }
>       failure.addAll((NamedList) addResultFailure);
>     } else {
>       SimpleOrderedMap success = (SimpleOrderedMap) results.get("success");
>       if (success == null) {
>         success = new SimpleOrderedMap();
>         results.add("success", success);
>       }
>       success.addAll((NamedList) addResult.get("success"));
>     }
>   });
> }{code}
>  
> This code works as the response can have either a failure or a success. But isn't it
the same as doing this? 
> {code:java}
> ocmh.addReplica(zkStateReader.getClusterState(), addReplicasProps, results, null);{code}
>  
> Maybe I am missing the motication here . [~caomanhdat] WDYT? If the usage is needed then
at-least I'd want to document the reason in the code for future refernece.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message