You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2023/10/05 21:36:40 UTC
[accumulo] 01/01: Merge commit '94c4e664afb7bec56e6debb58027576b896c129e'
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 1415599a5b744df3f79d05f9cd49b4fe0e458c1b
Merge: 191ea250bf 94c4e664af
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Oct 5 17:36:18 2023 -0400
Merge commit '94c4e664afb7bec56e6debb58027576b896c129e'
.../core/util/compaction/ExternalCompactionUtil.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --cc core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java
index 4e40165f09,6f336f0c2b..a7801043b6
--- a/core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java
@@@ -33,10 -35,9 +33,10 @@@ import org.apache.accumulo.core.Constan
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException;
import org.apache.accumulo.core.compaction.thrift.CompactorService;
-import org.apache.accumulo.core.fate.zookeeper.ServiceLock;
+ import org.apache.accumulo.core.fate.zookeeper.ZooCache.ZcStat;
import org.apache.accumulo.core.fate.zookeeper.ZooReader;
- import org.apache.accumulo.core.fate.zookeeper.ZooSession;
+import org.apache.accumulo.core.lock.ServiceLock;
+import org.apache.accumulo.core.lock.ServiceLockData.ThriftService;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.clients.ThriftClientTypes;
@@@ -100,14 -100,12 +100,8 @@@ public class ExternalCompactionUtil
*/
public static Optional<HostAndPort> findCompactionCoordinator(ClientContext context) {
final String lockPath = context.getZooKeeperRoot() + Constants.ZCOORDINATOR_LOCK;
- try {
- var zk = ZooSession.getAnonymousSession(context.getZooKeepers(),
- context.getZooKeepersSessionTimeOut());
- return ServiceLock.getLockData(zk, ServiceLock.path(lockPath))
- .map(sld -> sld.getAddress(ThriftService.COORDINATOR));
- } catch (KeeperException | InterruptedException e) {
- throw new IllegalStateException(e);
- byte[] address =
- ServiceLock.getLockData(context.getZooCache(), ServiceLock.path(lockPath), new ZcStat());
- if (null == address) {
- return Optional.empty();
-- }
- return Optional.of(HostAndPort.fromString(new String(address, UTF_8)));
++ return ServiceLock.getLockData(context.getZooCache(), ServiceLock.path(lockPath), new ZcStat())
++ .map(sld -> sld.getAddress(ThriftService.COORDINATOR));
}
/**