[
https://issues.apache.org/jira/browse/SOLR-12817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636594#comment-16636594
]
Andrzej Bialecki commented on SOLR-12817:
------------------------------------------
[~shalinmangar] I see - no, the old behavior is no longer needed, but then I
think the left-over lambda is not needed here either, we can just use the
regular {{ocmh.addReplica(zkStateReader.getClusterState(), addReplicasProps,
results, null);}}
> 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]