diff --git a/hbase-server/src/main/ruby/hbase/admin.rb b/hbase-server/src/main/ruby/hbase/admin.rb index 69e6343527f..5dd4a76fcb0 100644 --- a/hbase-server/src/main/ruby/hbase/admin.rb +++ b/hbase-server/src/main/ruby/hbase/admin.rb @@ -39,8 +39,8 @@ module Hbase #---------------------------------------------------------------------------------------------- # Returns a list of tables in hbase - def list - @admin.listTables.map { |t| t.getNameAsString } + def list(regex = ".*") + @admin.listTables(regex).map { |t| t.getNameAsString } end #---------------------------------------------------------------------------------------------- diff --git a/hbase-server/src/main/ruby/shell/commands/list.rb b/hbase-server/src/main/ruby/shell/commands/list.rb index 16af27b9c09..c43e0c4a347 100644 --- a/hbase-server/src/main/ruby/shell/commands/list.rb +++ b/hbase-server/src/main/ruby/shell/commands/list.rb @@ -34,8 +34,7 @@ EOF now = Time.now formatter.header([ "TABLE" ]) - regex = /#{regex}/ unless regex.is_a?(Regexp) - list = admin.list.grep(regex) + list = admin.list(regex) list.each do |table| formatter.row([ table ]) end