From ce83babe0bc1b3eb0480c815f035b1fcc549316f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A9=E5=B8=AE?= Date: Thu, 8 Nov 2018 18:10:45 +0800 Subject: [PATCH] HBASE-21455 Update filesystem-space quota fail if there is a space quota for non-existing namespace --- .../hadoop/hbase/quotas/QuotaObserverChore.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java index 869ead370a..c45f93b906 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java @@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.ScheduledChore; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; @@ -465,8 +466,14 @@ public class QuotaObserverChore extends ScheduledChore { if (namespace != null) { assert tableName == null; - // Collect all of the tables in the namespace - TableName[] tablesInNS = conn.getAdmin().listTableNamesByNamespace(namespace); + // Collect all of the tables in the namespace,if this namespace doesn't exist,skip it + TableName[] tablesInNS; + try { + tablesInNS = conn.getAdmin().listTableNamesByNamespace(namespace); + } catch (NamespaceNotFoundException e) { + LOG.warn("NameSpace " + namespace + " doesn't exist,skip it"); + continue; + } for (TableName tableUnderNs : tablesInNS) { if (LOG.isTraceEnabled()) { LOG.trace("Adding " + tableUnderNs + " under " + namespace -- 2.17.2 (Apple Git-113)