Skip to content

Commit

Permalink
Rename setKnownHosts
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbiscoc committed Jan 3, 2025
1 parent 00368b5 commit 52ea46b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public abstract class BaseHttpClusterStateProvider implements ClusterStateProvid
private String urlScheme;
private Set<String> initialNodes;
volatile Set<String> liveNodes;
volatile Set<String> knownNodes; // Live nodes + initial nodes
volatile Set<String> knownNodes;
long liveNodesTimestamp = 0;
volatile Map<String, List<String>> aliases;
volatile Map<String, Map<String, String>> aliasProperties;
Expand All @@ -69,7 +69,7 @@ public void init(List<String> solrUrls) throws Exception {
try (SolrClient initialClient = getSolrClient(solrUrl)) {
this.liveNodes = fetchLiveNodes(initialClient);
this.initialNodes = Set.copyOf(liveNodes);
updateKnownNodes();
setKnownNodes();
liveNodesTimestamp = System.nanoTime();
break;
} catch (SolrServerException | IOException e) {
Expand Down Expand Up @@ -142,7 +142,7 @@ private ClusterState fetchClusterState(SolrClient client)
List<String> liveNodesList = (List<String>) cluster.get("live_nodes");
if (liveNodesList != null) {
this.liveNodes = Set.copyOf(liveNodesList);
updateKnownNodes();
setKnownNodes();
liveNodesTimestamp = System.nanoTime();
}

Expand Down Expand Up @@ -236,7 +236,7 @@ > getCacheTimeout()) {
String baseUrl = Utils.getBaseUrlForNodeName(nodeName, urlScheme);
try (SolrClient client = getSolrClient(baseUrl)) {
this.liveNodes = fetchLiveNodes(client);
updateKnownNodes();
setKnownNodes();
liveNodesTimestamp = System.nanoTime();
return this.liveNodes;
} catch (Exception e) {
Expand Down Expand Up @@ -427,7 +427,7 @@ public Set<String> getKnownNodes() {
* Known nodes should always have the latest set of live nodes but never remove initial set of
* live nodes
*/
private void updateKnownNodes() {
private void setKnownNodes() {
Set<String> knownNodes = new HashSet<>(this.liveNodes);
knownNodes.addAll(this.initialNodes);
this.knownNodes = Set.copyOf(knownNodes);
Expand Down

0 comments on commit 52ea46b

Please sign in to comment.