accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/8] git commit: ACCUMULO-2093 Exclude incomplete tables from listing.
Date Thu, 26 Dec 2013 21:48:11 GMT
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 <ctubbsii@apache.org>
Authored: Tue Dec 24 16:18:15 2013 -0500
Committer: Christopher Tubbs <ctubbsii@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);


Mime
View raw message