Skip to content

Commit

Permalink
more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-anderson committed Dec 18, 2024
1 parent d25ce66 commit b7aa812
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public HostObserver hostObserver(Object resolvedAddress) {

@Override
public void onServiceDiscoveryEvent(Collection<? extends ServiceDiscovererEvent<?>> events) {
LOGGER.debug("{}- onServiceDiscoveryEvent(events: {}, size {})", lbDescription, events, events.size());
LOGGER.debug("{}- onServiceDiscoveryEvent(events: {}, count {})", lbDescription, events, events.size());
}

@Override
Expand All @@ -57,7 +57,7 @@ public void onHostsUpdate(Collection<? extends Host> oldHosts, Collection<? exte
healthyCount++;
}
}
LOGGER.debug("{}- onHostsUpdate(old hosts: {}, new hosts: {}), old hosts size: {}, new hosts size: {}, " +
LOGGER.debug("{}- onHostsUpdate(old hosts: {}, new hosts: {}), old host count: {}, new host count: {}, " +
"new healthy count: {}",
lbDescription, oldHosts, newHosts, oldHosts.size(), newHosts.size(), healthyCount);
}
Expand All @@ -70,7 +70,8 @@ public void onNoAvailableHostException(final NoAvailableHostException exception)

@Override
public void onNoActiveHostException(Collection<? extends Host> hosts, NoActiveHostException exception) {
LOGGER.debug("{}- onNoActiveHostException(hosts: {})", lbDescription, hosts, exception);
LOGGER.debug("{}- onNoActiveHostException(hosts: {}, host count: {})", lbDescription, hosts, hosts.size(),
exception);
}

private final class HostObserverImpl implements HostObserver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ private void sequentialUpdateUsedHosts(List<PrioritizedHostImpl<ResolvedAddress,
} else {
newHostSelector = oldHostSelector;
}
final Collection<? extends Host<ResolvedAddress, C>> newHosts = newHostSelector.hosts();
final Collection<? extends LoadBalancerObserver.Host> newHosts = newHostSelector.hosts();
loadBalancerObserver.onHostsUpdate(Collections.unmodifiableCollection(oldHostSelector.hosts()),
Collections.unmodifiableCollection(newHosts));
LOGGER.debug("{}: Using addresses (size={}): {}.", this, newHosts.size(), newHosts);
Expand Down Expand Up @@ -632,7 +632,7 @@ public boolean isHealthy() {
}

@Override
public List<? extends Host<ResolvedAddress, C>> hosts() {
public Collection<? extends LoadBalancerObserver.Host> hosts() {
return emptyList();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ Single<C> selectConnection(Predicate<C> selector, @Nullable ContextMap context,
* due to various filtering mechanisms.
* @return the set of hosts this selector will pick from.
*/
Collection<? extends Host<ResolvedAddress, C>> hosts();
Collection<? extends LoadBalancerObserver.Host> hosts();
}
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public boolean isHealthy() {
}

@Override
public List<? extends Host<String, TestLoadBalancedConnection>> hosts() {
public Collection<? extends LoadBalancerObserver.Host> hosts() {
return hosts;
}
}
Expand Down

0 comments on commit b7aa812

Please sign in to comment.