Skip to content

Commit

Permalink
Optimize DiscoveryNodeManager.refreshNodeInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
mayunlei authored and tdcmeehan committed Oct 2, 2023
1 parent 93ac346 commit a635c34
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ private synchronized void refreshNodesInternal()
{
// This is currently a blacklist.
// TODO: make it a whitelist (a failure-detecting service selector) and maybe build in support for injecting this in airlift
Set<ServiceDescriptor> failed = failureDetector.getFailed();
Set<ServiceDescriptor> services = serviceSelector.selectAllServices().stream()
.filter(service -> !failureDetector.getFailed().contains(service))
.filter(service -> !failed.contains(service))
.filter(filterRelevantNodes())
.collect(toImmutableSet());

Expand Down

0 comments on commit a635c34

Please sign in to comment.