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

Noble Paul commented on SOLR-10446:
-----------------------------------

* this has no error handling when there is no collection with that name 
available
* code like below is bad
{code:java}
Set<String> liveNodes = new 
HashSet((List<String>)(clusterStateMap.get("live_nodes")));
    if (liveNodes != null) {
      this.liveNodes = liveNodes;
      liveNodesTimestamp = System.nanoTime();
    }
{code}
how can liveNodes be null

what kind of exception are you trying to catch and why? what is the point in 
hitting another server after you get a SolrException?
{code}
try (HttpSolrClient client = new HttpSolrClient.Builder().
          withBaseSolrUrl(ZkStateReader.getBaseUrlForNodeName(nodeName, 
urlScheme)).
          withHttpClient(httpClient).build()) {
        ClusterState cs = fetchClusterState(client, collection);
        return cs.getCollectionRef(collection);
      } catch (SolrServerException | IOException e) {
        log.warn("Attempt to fetch cluster state from " +
            ZkStateReader.getBaseUrlForNodeName(nodeName, urlScheme) + " 
failed.", e);
      }
{code}

NamedList#asMap() does a deep copy . why do you even do it here?
{code}
 NamedList cluster = (SimpleOrderedMap) client.request(request).get("cluster");
   Map<String, Object> clusterStateMap = cluster.asMap(10); // contains 
live_nodes and collections
{code}

> Http based ClusterStateProvider (CloudSolrClient needn't talk to ZooKeeper)
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-10446
>                 URL: https://issues.apache.org/jira/browse/SOLR-10446
>             Project: Solr
>          Issue Type: Sub-task
>          Components: SolrJ
>            Reporter: Ishan Chattopadhyaya
>         Attachments: SOLR-10446.patch, SOLR-10446.patch, SOLR-10446.patch, 
> SOLR-10446.patch, SOLR-10446.patch, SOLR-9057.patch
>
>
> An HTTP based ClusterStateProvider to remove the sole dependency of 
> CloudSolrClient on ZooKeeper, and hence provide an optional way for CSC to 
> access cluster state without requiring ZK.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to