Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3516C100F4 for ; Thu, 26 Dec 2013 21:48:12 +0000 (UTC) Received: (qmail 63320 invoked by uid 500); 26 Dec 2013 21:48:11 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 63287 invoked by uid 500); 26 Dec 2013 21:48:11 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 63251 invoked by uid 99); 26 Dec 2013 21:48:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Dec 2013 21:48:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 870ED51DFB; Thu, 26 Dec 2013 21:48:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Thu, 26 Dec 2013 21:48:11 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/8] git commit: ACCUMULO-2093 Exclude incomplete tables from listing. Updated Branches: refs/heads/master 00bcb0cb0 -> 8553b4678 ACCUMULO-2093 Exclude incomplete tables from listing. Specifically, tables who can't resolve with a fully-qualified table name are excluded from a table listing. This ensures that tables being created and/or deleted aren't shown in an inconsistent state. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3cddee9e Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3cddee9e Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3cddee9e Branch: refs/heads/master Commit: 3cddee9ef10049219b551d578bbfa9f779697993 Parents: db74696 Author: Christopher Tubbs Authored: Tue Dec 24 16:18:15 2013 -0500 Committer: Christopher Tubbs Committed: Tue Dec 24 16:18:15 2013 -0500 ---------------------------------------------------------------------- .../java/org/apache/accumulo/core/client/impl/Tables.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/3cddee9e/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java index 7cf5ccc..f3f46d5 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java @@ -53,9 +53,7 @@ public class Tables { ZooCache zc = getZooCache(instance); List tableIds = zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES); - TreeMap tableMap = new TreeMap(); - Map namespaceIdToNameMap = new HashMap(); for (String tableId : tableIds) { @@ -63,7 +61,9 @@ public class Tables { byte[] nId = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAMESPACE); String namespaceName = Constants.DEFAULT_NAMESPACE; // create fully qualified table name - if (nId != null) { + if (nId == null) { + namespaceName = null; + } else if (nId != null) { String namespaceId = new String(nId, Constants.UTF8); if (!namespaceId.equals(Constants.DEFAULT_NAMESPACE_ID)) { try { @@ -73,12 +73,12 @@ public class Tables { namespaceIdToNameMap.put(namespaceId, namespaceName); } } catch (NamespaceNotFoundException e) { - log.error("Table (" + tableId + ") contains reference to namespace (" + namespaceId + ") that doesn't exist"); + log.error("Table (" + tableId + ") contains reference to namespace (" + namespaceId + ") that doesn't exist", e); continue; } } } - if (tableName != null) { + if (tableName != null && namespaceName != null) { String tableNameStr = qualified(new String(tableName, Constants.UTF8), namespaceName); if (nameAsKey) tableMap.put(tableNameStr, tableId);