mlbiscoc commented on code in PR #3249:
URL: https://github.com/apache/solr/pull/3249#discussion_r1987240404


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseHttpClusterStateProvider.java:
##########
@@ -230,43 +214,41 @@ private SimpleOrderedMap<?> submitClusterStateRequest(
   }
 
   @Override
-  public Set<String> getLiveNodes() {
+  public synchronized Set<String> getLiveNodes() {
+    // synchronized because there's no value in multiple doing this at the 
same time
     if (TimeUnit.SECONDS.convert((System.nanoTime() - liveNodesTimestamp), 
TimeUnit.NANOSECONDS)
-        > getCacheTimeout()) {
+        <= getCacheTimeout()) {
+      return this.liveNodes; // cached copy is fresh enough
+    }
 
+    if (liveNodes != null) { // thus we've fetched liveNodes previously

Review Comment:
   Nevermind ignore what I said. I misinterpreted this...



##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseHttpClusterStateProvider.java:
##########
@@ -78,28 +78,12 @@ public void init(List<String> solrUrls) throws Exception {
                   }
                 })
             .collect(Collectors.toList());
+    this.urlScheme = this.configuredNodes.get(0).getProtocol();

Review Comment:
   Cool, yeah small change and I like this a lot better!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to