This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 7b099dd758 Fix TServerClient.getThriftServerConnection for compactor 
queue names (#3984)
7b099dd758 is described below

commit 7b099dd7584f8a2701014c41f3912c0ce5dc8913
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Nov 27 16:35:36 2023 -0500

    Fix TServerClient.getThriftServerConnection for compactor queue names 
(#3984)
    
    This fixes an issue introduced in #3951 where the Compactor and
    ScanServer now expose the ClientService. The issue fixed here is
    that #3951 did not account for the extra part in the compactor path
    in ZooKeeper that is used for the queue name.
---
 .../accumulo/core/rpc/clients/TServerClient.java   | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java 
b/core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java
index 121bde735b..f96d9f62df 100644
--- a/core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/rpc/clients/TServerClient.java
@@ -72,11 +72,23 @@ public interface TServerClient<C extends TServiceClient> {
     }
     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)) {
+        // 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);
+        }
       }
     }
 

Reply via email to