iamsanjay commented on code in PR #2832: URL: https://github.com/apache/solr/pull/2832#discussion_r1826151010
########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java: ########## @@ -56,10 +56,14 @@ protected CloudHttp2SolrClient(Builder builder) { super(builder.shardLeadersOnly, builder.parallelUpdates, builder.directUpdatesToLeadersOnly); this.clientIsInternal = builder.httpClient == null; this.myClient = createOrGetHttpClientFromBuilder(builder); - this.stateProvider = - builder.zkHosts.isEmpty() - ? createHttp2ClusterStateProvider(builder.solrUrls, myClient) - : createZkClusterStateProvider(builder); + + try { + ClusterStateProviderFactory factory = new ClusterStateProviderFactory(builder, myClient); + this.stateProvider = factory.create(); Review Comment: There were already two Factory method there -- one for ZkClientClusterStateProvider and another HttpCSP. My idea is to encapsulate that and the new custom logic into one unit. So that it should be easier for others to read this code. Yes I can move this class to builder so that we deal with stateProvider in the builder only rather than moving it to the main class. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org