Updated Branches:
  refs/heads/1.6.0-SNAPSHOT db746960f -> 3cddee9ef

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/1.6.0-SNAPSHOT
Commit: 3cddee9ef10049219b551d578bbfa9f779697993
Parents: db74696
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Tue Dec 24 16:18:15 2013 -0500
Committer: Christopher Tubbs <ctubb...@apache.org>
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<String> tableIds = zc.getChildren(ZooUtil.getRoot(instance) + 
Constants.ZTABLES);
-
     TreeMap<String,String> tableMap = new TreeMap<String,String>();
-
     Map<String,String> namespaceIdToNameMap = new HashMap<String,String>();
 
     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);

Reply via email to