From 52c101389ee77fe28b8665ecab86782eda77321d Mon Sep 17 00:00:00 2001 From: binlijin Date: Wed, 1 Apr 2020 14:16:57 +0800 Subject: [PATCH] HBASE-24096 Fix TestRSGroupsBalance (#1402) Signed-off-by: Reid Chan Signed-off-by: stack --- .../apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java | 2 +- .../java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index 8d7addb5ddcb..5b2e8bf4c9d7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -223,7 +223,7 @@ static class RSGroupMappingScript { String getRSGroup(String namespace, String tablename) { if (rsgroupMappingScript == null) { - return RSGroupInfo.DEFAULT_GROUP; + return null; } String[] exec = rsgroupMappingScript.getExecString(); exec[1] = namespace; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java index 5f51c96bd5d3..08c545327a3e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupUtil.java @@ -87,7 +87,10 @@ public static Optional getRSGroupInfo(MasterServices master, } // RSGroup information determined by administrator. String groupDeterminedByAdmin = manager.determineRSGroupInfoForTable(tableName); - RSGroupInfo groupInfo = manager.getRSGroup(groupDeterminedByAdmin); + RSGroupInfo groupInfo = null; + if (groupDeterminedByAdmin != null) { + groupInfo = manager.getRSGroup(groupDeterminedByAdmin); + } if (groupInfo != null) { return Optional.of(groupInfo); }