dlmarion commented on code in PR #4880:
URL: https://github.com/apache/accumulo/pull/4880#discussion_r1758705678
##########
core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java:
##########
@@ -79,18 +83,30 @@ default Pair<String,C> getThriftServerConnection(Logger
LOG, ThriftClientTypes<C
final ZooCache zc = context.getZooCache();
final List<String> serverPaths = new ArrayList<>();
- zc.getChildren(tserverZooPath).forEach(tserverAddress -> {
- serverPaths.add(tserverZooPath + "/" + tserverAddress);
- });
- if (type == ThriftClientTypes.CLIENT) {
- zc.getChildren(sserverZooPath).forEach(sserverAddress -> {
- serverPaths.add(sserverZooPath + "/" + sserverAddress);
- });
+ if (type == ThriftClientTypes.CLIENT && preferredClientHost != null) {
+ // add all three paths to the set even though they may not be correct.
+ // The entire set will be checked in the code below to validate
+ // that the path is correct and the lock is held and will return the
+ // correct one.
+ serverPaths.add(tserverZooPath + "/" + preferredClientHost);
Review Comment:
Yes, the paths in zookeeper contain the host and port.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]