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

Andrzej Bialecki  commented on SOLR-12817:
------------------------------------------

{{CreateShardCmd}} used to wait for all replica positions to be allocated, and 
ticked a CountDownLatch inside the response builder, hence the need for a 
custom response builder lambda. The current code on master doesn't do that 
anymore, which is a little surprising - this was removed during refactoring in 
4bcace571ee. I think this should should still be there, and it's still there on 
branch_7x. What do you think [~shalinmangar]?

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to