adutra commented on code in PR #1896: URL: https://github.com/apache/cassandra-java-driver/pull/1896#discussion_r1446150652
########## core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/BasicLoadBalancingPolicy.java: ########## @@ -325,24 +338,63 @@ protected Queue<Node> maybeAddDcFailover(@Nullable Request request, @NonNull Que @Override protected Object[] computeNodes() { - Object[] remoteNodes = - liveNodes.dcs().stream() - .filter(Predicates.not(Predicates.equalTo(localDc))) - .flatMap(dc -> liveNodes.dc(dc).stream().limit(maxNodesPerRemoteDc)) - .toArray(); - - int remoteNodesLength = remoteNodes.length; - if (remoteNodesLength == 0) { - return EMPTY_NODES; + if (!preferredRemoteLocalDcs.isEmpty()) { Review Comment: Yes, that is the big question here. I'm hesitating on the practical usefulness vs added complexity, but I think it makes sense to do as you suggest. If you take my code snippet above, this should be easily doable by changing the `flatMap` operator. -- 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: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org