nitinitt commented on code in PR #1896:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1896#discussion_r1440126405


##########
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:
   Should the nodes within the same preferred remote DC be shuffled? For eg: If 
node1, node2 are in remote dc1 and node3, node4 in remote dc2 and 
maxNodesPerRemoteDc=2 and preference order specified is dc1, dc2.  In this 
example, the remote nodes in query plan will always be: node1, node2, node3, 
node4. Does it make sense to shuffle the nodes within a preferred remote DC, 
i.e it can be ((node2, node1), (node4, node3))?



-- 
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

Reply via email to