ddanielr commented on code in PR #3984:
URL: https://github.com/apache/accumulo/pull/3984#discussion_r1406651829
##########
core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java:
##########
@@ -72,11 +72,23 @@ default Pair<String,C> getThriftServerConnection(Logger
LOG, ThriftClientTypes<C
}
ZooCache zc = context.getZooCache();
for (String serverPath : serverPaths) {
- for (String server : zc.getChildren(serverPath)) {
- var zLocPath = ServiceLock.path(serverPath + "/" + server);
- zc.getLockData(zLocPath).map(sld -> sld.getAddress(service))
- .map(address -> new ThriftTransportKey(address, rpcTimeout,
context))
- .ifPresent(servers::add);
+ if (!serverPath.endsWith(Constants.ZCOMPACTORS)) {
+ for (String server : zc.getChildren(serverPath)) {
+ var zLocPath = ServiceLock.path(serverPath + "/" + server);
+ zc.getLockData(zLocPath).map(sld -> sld.getAddress(service))
+ .map(address -> new ThriftTransportKey(address, rpcTimeout,
context))
+ .ifPresent(servers::add);
+ }
+ } else {
Review Comment:
Yeah I was suggesting dropping the negation for readability.
Since you have two server paths (`ZTSERVERS` & `ZSSERVERS`) that use the
same parsing and only one `ZCOMPACTORS` that uses a different data path.
```
for (String serverPath : serverPaths) {
if (serverPath.endsWith(Constants.ZCOMPACTORS)) {
// Compactor path has another subdirectory, the group / queue name
for (String groupName : zc.getChildren(serverPath)) {
for (String server : zc.getChildren(serverPath + "/" + groupName))
{
var zLocPath = ServiceLock.path(serverPath + "/" + groupName +
"/" + server);
zc.getLockData(zLocPath).map(sld -> sld.getAddress(service))
.map(address -> new ThriftTransportKey(address, rpcTimeout,
context))
.ifPresent(servers::add);
}
}
} else {
for (String server : zc.getChildren(serverPath)) {
var zLocPath = ServiceLock.path(serverPath + "/" + server);
zc.getLockData(zLocPath).map(sld -> sld.getAddress(service))
.map(address -> new ThriftTransportKey(address, rpcTimeout,
context))
.ifPresent(servers::add);
}
}
}
```
--
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]