Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ private void refreshLiveNodes(Watcher watcher) throws KeeperException, Interrupt
}

public void registerClusterPropertiesListener(ClusterPropertiesListener listener) {
log.debug("registerClusterPropertiesListener");
// fire it once with current properties
if (listener.onChange(getClusterProperties())) {
removeClusterPropertiesListener(listener);
Expand All @@ -862,6 +863,7 @@ public void removeClusterPropertiesListener(ClusterPropertiesListener listener)
}

public void registerLiveNodesListener(LiveNodesListener listener) {
log.debug("registerLiveNodesListener");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: called indirectly via waitForState if there was not a cache hit

// fire it once with current live nodes
if (listener.onChange(
new TreeSet<>(getClusterState().getLiveNodes()),
Expand Down Expand Up @@ -1003,7 +1005,7 @@ public Replica getLeaderRetry(String collection, String shard, int timeout)
if (c == null) return false;
Replica l = getLeader(n, c, shard);
if (l != null) {
log.debug("leader found for {}/{} to be {}", collection, shard, l);
log.trace("leader found for {}/{} to be {}", collection, shard, l);
leader.set(l);
return true;
}
Expand Down Expand Up @@ -1608,6 +1610,7 @@ public void registerCollectionStateWatcher(
*/
public void registerDocCollectionWatcher(
String collection, DocCollectionWatcher docCollectionWatcher) {
log.debug("registerDocCollectionWatcher collection={}", collection);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: called indirectly via waitForState if there was not a cache hit

AtomicReference<StateWatcher> newWatcherRef = new AtomicReference<>();
collectionWatches.compute(
collection,
Expand Down Expand Up @@ -1664,7 +1667,7 @@ public void waitForState(
DocCollection docCollection = clusterState.getCollectionOrNull(collection);
if (liveNodes != null && docCollection != null) {
if (predicate.matches(liveNodes, docCollection)) {
log.debug("Found {} directly in clusterState", predicate);
log.trace("waitForState collection={}: cache hit in clusterState", collection);
return;
}
}
Expand Down Expand Up @@ -1746,7 +1749,7 @@ public DocCollection waitForState(
DocCollection docCollection = clusterState.getCollectionOrNull(collection);
if (docCollection != null) {
if (predicate.test(docCollection)) {
log.debug("Found {} directly in clusterState", predicate);
log.trace("waitForState collection={}: cache hit in clusterState", collection);
return docCollection;
}
}
Expand Down
Loading