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 d3925b7af2e3c014442aaa91418ca7115fd32921 Merge: bf16a1d302 e560e0e0c3 Author: Christopher Tubbs <ctubb...@apache.org> AuthorDate: Fri Nov 15 02:37:22 2024 -0500 Merge branch '3.1' This merges #4996 into the main branch .../java/org/apache/accumulo/core/Constants.java | 1 - .../accumulo/core/clientImpl/ClientContext.java | 6 + .../accumulo/core/clientImpl/NamespaceMapping.java | 164 +++++++++++++++++++++ .../accumulo/core/clientImpl/Namespaces.java | 56 +------ .../core/clientImpl/NamespaceMappingTest.java | 72 +++++++++ .../accumulo/server/init/ZooKeeperInitializer.java | 7 +- .../accumulo/server/tables/TableManager.java | 34 +++-- .../apache/accumulo/manager/tableOps/Utils.java | 12 -- .../create/PopulateZookeeperWithNamespace.java | 16 +- .../tableOps/namespace/rename/RenameNamespace.java | 23 +-- .../accumulo/manager/upgrade/Upgrader11to12.java | 29 +++- .../manager/upgrade/Upgrader11to12Test.java | 43 +++++- 12 files changed, 351 insertions(+), 112 deletions(-) diff --cc core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java index f5bc596872,298a14329d..3c93a6d39e --- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java +++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java @@@ -143,7 -142,7 +143,8 @@@ public class ClientContext implements A private final Supplier<SaslConnectionParams> saslSupplier; private final Supplier<SslConnectionParams> sslSupplier; private final Supplier<ScanServerSelector> scanServerSelectorSupplier; + private final Supplier<ServiceLockPaths> serverPaths; + private final NamespaceMapping namespaces; private TCredentials rpcCreds; private ThriftTransportPool thriftTransportPool; private ZookeeperLockChecker zkLockChecker; @@@ -1072,8 -1116,8 +1074,12 @@@ return this.zkLockChecker; } + public ServiceLockPaths getServerPaths() { + return this.serverPaths.get(); + } + + public NamespaceMapping getNamespaces() { + return namespaces; + } + } diff --cc server/base/src/main/java/org/apache/accumulo/server/init/ZooKeeperInitializer.java index c5e770ee74,1fc771dc09..8ed840815d --- a/server/base/src/main/java/org/apache/accumulo/server/init/ZooKeeperInitializer.java +++ b/server/base/src/main/java/org/apache/accumulo/server/init/ZooKeeperInitializer.java @@@ -21,12 -21,12 +21,14 @@@ package org.apache.accumulo.server.init import static java.nio.charset.StandardCharsets.UTF_8; import java.io.IOException; + import java.util.Map; import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.admin.TabletAvailability; import org.apache.accumulo.core.client.admin.TimeType; import org.apache.accumulo.core.clientImpl.Namespace; + import org.apache.accumulo.core.clientImpl.NamespaceMapping; +import org.apache.accumulo.core.clientImpl.TabletAvailabilityUtil; import org.apache.accumulo.core.data.InstanceId; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; diff --cc server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java index fca334cec3,8fc09eac2c..3662278944 --- a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java @@@ -252,22 -254,10 +252,10 @@@ public class Utils return tableNameLock; } - public static Lock getReadLock(Manager env, AbstractId<?> id, long tid) { - return Utils.getLock(env.getContext(), id, tid, LockType.READ); + public static Lock getReadLock(Manager env, AbstractId<?> id, FateId fateId) { + return Utils.getLock(env.getContext(), id, fateId, LockType.READ); } - public static void checkNamespaceDoesNotExist(ServerContext context, String namespace, - NamespaceId namespaceId, TableOperation operation) - throws AcceptableThriftTableOperationException { - - NamespaceId n = Namespaces.lookupNamespaceId(context, namespace); - - if (n != null && !n.equals(namespaceId)) { - throw new AcceptableThriftTableOperationException(null, namespace, operation, - TableOperationExceptionType.NAMESPACE_EXISTS, null); - } - } - /** * Given a fully-qualified Path and a flag indicating if the file info is base64 encoded or not, * retrieve the data from a file on the file system. It is assumed that the file is textual and diff --cc server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/create/PopulateZookeeperWithNamespace.java index af77b469e5,b47223f151..7d839f41c0 --- a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/create/PopulateZookeeperWithNamespace.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/create/PopulateZookeeperWithNamespace.java @@@ -18,8 -18,9 +18,10 @@@ */ package org.apache.accumulo.manager.tableOps.namespace.create; + import org.apache.accumulo.core.Constants; + import org.apache.accumulo.core.clientImpl.NamespaceMapping; import org.apache.accumulo.core.clientImpl.thrift.TableOperation; +import org.apache.accumulo.core.fate.FateId; import org.apache.accumulo.core.fate.Repo; import org.apache.accumulo.core.fate.zookeeper.DistributedReadWriteLock.LockType; import org.apache.accumulo.core.fate.zookeeper.ZooUtil.NodeExistsPolicy; diff --cc server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/rename/RenameNamespace.java index 82763a9835,b1fcb9f30b..67b1bd45f2 --- a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/rename/RenameNamespace.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/namespace/rename/RenameNamespace.java @@@ -18,14 -18,10 +18,11 @@@ */ package org.apache.accumulo.manager.tableOps.namespace.rename; - import static java.nio.charset.StandardCharsets.UTF_8; - import org.apache.accumulo.core.Constants; - import org.apache.accumulo.core.clientImpl.AcceptableThriftTableOperationException; + import org.apache.accumulo.core.clientImpl.NamespaceMapping; import org.apache.accumulo.core.clientImpl.thrift.TableOperation; - import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType; import org.apache.accumulo.core.data.NamespaceId; +import org.apache.accumulo.core.fate.FateId; import org.apache.accumulo.core.fate.Repo; import org.apache.accumulo.core.fate.zookeeper.DistributedReadWriteLock.LockType; import org.apache.accumulo.core.fate.zookeeper.ZooReaderWriter;