diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 4c6b667b1f2..14d7ad09102 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -3133,7 +3133,7 @@ MasterServices, Server { public List listTableNamesByNamespace(String name) throws IOException { List tableNames = Lists.newArrayList(); for (HTableDescriptor descriptor: tableDescriptors.getByNamespace(name).values()) { - tableNames.add(TableName.valueOf(name, descriptor.getNameAsString())); + tableNames.add(descriptor.getTableName()); } return tableNames; } diff --git a/hbase-server/src/test/ruby/hbase/admin_test.rb b/hbase-server/src/test/ruby/hbase/admin_test.rb index fd6abca0425..ff2f4227c0f 100644 --- a/hbase-server/src/test/ruby/hbase/admin_test.rb +++ b/hbase-server/src/test/ruby/hbase/admin_test.rb @@ -77,6 +77,14 @@ module Hbase assert(!admin.list.member?('hbase:meta')) end + define_test "list_namespace_tables for the system namespace should return a list of tables" do + assert(admin.list_namespace_tables('hbase').count > 0) + end + + define_test "list_namespace_tables for the default namespace should return a list of tables" do + assert(admin.list_namespace_tables('default').count > 0) + end + #------------------------------------------------------------------------------- define_test "flush should work" do