Merge branch '1.8' Conflicts: minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2f5203c2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2f5203c2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2f5203c2 Branch: refs/heads/master Commit: 2f5203c2408a0f3a0b5dbbdca9fa0516f8633c46 Parents: b31ce44 b903766 Author: Keith Turner <ktur...@apache.org> Authored: Wed Jan 25 12:54:09 2017 -0500 Committer: Keith Turner <ktur...@apache.org> Committed: Wed Jan 25 12:54:09 2017 -0500 ---------------------------------------------------------------------- .../org/apache/accumulo/fate/AdminUtil.java | 104 +++++++++++-- .../accumulo/cluster/AccumuloCluster.java | 6 + .../standalone/StandaloneAccumuloCluster.java | 12 ++ .../impl/MiniAccumuloClusterImpl.java | 7 + .../accumulo/master/FateServiceHandler.java | 2 +- .../accumulo/master/tableOps/DeleteTable.java | 33 +---- .../test/functional/BackupMasterIT.java | 7 +- .../functional/ConcurrentDeleteTableIT.java | 147 +++++++++++++++++++ 8 files changed, 278 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f5203c2/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java ---------------------------------------------------------------------- diff --cc minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java index 84148ae,829b321..2d60b0c --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java @@@ -112,7 -110,10 +113,8 @@@ import org.slf4j.LoggerFactory import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; -import com.google.common.base.Predicate; + import com.google.common.collect.Iterables; import com.google.common.collect.Maps; -import com.google.common.util.concurrent.Uninterruptibles; /** * This class provides the backing implementation for {@link MiniAccumuloCluster}, and may contain features for internal testing which have not yet been @@@ -839,4 -838,10 +841,9 @@@ public class MiniAccumuloClusterImpl im return new Path(tmp.toString()); } } + + @Override + public AccumuloConfiguration getSiteConfiguration() { - // TODO Auto-generated method stub + return new ConfigurationCopy(Iterables.concat(AccumuloConfiguration.getDefaultConfiguration(), config.getSiteConfig().entrySet())); + } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f5203c2/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f5203c2/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java ---------------------------------------------------------------------- diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java index 8ee385c,1eae5b9..c0bf48b --- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java +++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java @@@ -29,45 -27,42 +27,28 @@@ public class DeleteTable extends Master private static final long serialVersionUID = 1L; private String tableId; + private String namespaceId; - public DeleteTable(String tableId) { - private String getNamespaceId(Master environment) throws Exception { - if (namespaceId == null) { - // For ACCUMULO-4575 namespaceId was added in a bug fix release. Since it was added in bug fix release, we have to ensure we can properly deserialize - // older versions. When deserializing an older version, namespaceId will be null. For this case revert to the old buggy behavior. - return Utils.getNamespaceId(environment.getInstance(), tableId, TableOperation.DELETE); - } - - return namespaceId; - } - + public DeleteTable(String namespaceId, String tableId) { + this.namespaceId = namespaceId; this.tableId = tableId; } @Override public long isReady(long tid, Master environment) throws Exception { - try { - String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId); - return Utils.reserveNamespace(namespaceId, tid, false, false, TableOperation.DELETE) - + Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE); - } catch (IllegalArgumentException ex) { - if (ex.getCause() != null && ex.getCause() instanceof TableNotFoundException) { - return 0; - } - throw ex; - } - String namespaceId = getNamespaceId(environment); + return Utils.reserveNamespace(namespaceId, tid, false, false, TableOperation.DELETE) + Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE); } @Override public Repo<Master> call(long tid, Master environment) throws Exception { - try { - String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId); - TableManager.getInstance().transitionTableState(tableId, TableState.DELETING); - environment.getEventCoordinator().event("deleting table %s ", tableId); - return new CleanUp(tableId, namespaceId); - } catch (IllegalArgumentException ex) { - if (ex.getCause() != null && ex.getCause() instanceof TableNotFoundException) { - return null; - } - throw ex; - } - String namespaceId = getNamespaceId(environment); + TableManager.getInstance().transitionTableState(tableId, TableState.DELETING); + environment.getEventCoordinator().event("deleting table %s ", tableId); + return new CleanUp(tableId, namespaceId); } @Override public void undo(long tid, Master environment) throws Exception { - String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId); - if (namespaceId != null) { - Utils.unreserveNamespace(namespaceId, tid, false); - } + Utils.unreserveNamespace(namespaceId, tid, false); Utils.unreserveTable(tableId, tid, true); } - }