Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D4E017839 for ; Thu, 26 Feb 2015 15:07:32 +0000 (UTC) Received: (qmail 57384 invoked by uid 500); 26 Feb 2015 15:07:27 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 57345 invoked by uid 500); 26 Feb 2015 15:07:27 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 57334 invoked by uid 99); 26 Feb 2015 15:07:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 15:07:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3BB4DE0531; Thu, 26 Feb 2015 15:07:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-13111 truncate_preserve command is failing with undefined method error (Ashish Singhi) Date: Thu, 26 Feb 2015 15:07:27 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/master 1c957b65b -> 49b4f3737 HBASE-13111 truncate_preserve command is failing with undefined method error (Ashish Singhi) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/49b4f373 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/49b4f373 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/49b4f373 Branch: refs/heads/master Commit: 49b4f3737eb0dd7c5d88d6dcbe8b5d4f167c6a2b Parents: 1c957b6 Author: tedyu Authored: Thu Feb 26 07:07:19 2015 -0800 Committer: tedyu Committed: Thu Feb 26 07:07:19 2015 -0800 ---------------------------------------------------------------------- hbase-shell/src/main/ruby/hbase/admin.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/49b4f373/hbase-shell/src/main/ruby/hbase/admin.rb ---------------------------------------------------------------------- diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index f8ab36e..12571d9 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -34,7 +34,7 @@ module Hbase def initialize(admin, formatter) @admin = admin - connection = @admin.getConnection() + @connection = @admin.getConnection() @formatter = formatter end @@ -399,14 +399,14 @@ module Hbase #---------------------------------------------------------------------------------------------- # Truncates table while maintaing region boundaries (deletes all records by recreating the table) def truncate_preserve(table_name, conf = @conf) - h_table = @conn.getTable(table_name) - locator = @conn.getRegionLocator(table_name) + h_table = @connection.getTable(TableName.valueOf(table_name)) + locator = @connection.getRegionLocator(TableName.valueOf(table_name)) splits = locator.getAllRegionLocations(). map{|i| Bytes.toString(i.getRegionInfo().getStartKey)}. delete_if{|k| k == ""}.to_java :String locator.close() - table_description = @admin.getTableDescriptor(table_name) + table_description = @admin.getTableDescriptor(TableName.valueOf(table_name)) yield 'Disabling table...' if block_given? disable(table_name) @@ -784,7 +784,7 @@ module Hbase # Enables/disables a region by name def online(region_name, on_off) # Open meta table - meta = connection.getTable(org.apache.hadoop.hbase.TableName::META_TABLE_NAME) + meta = @connection.getTable(org.apache.hadoop.hbase.TableName::META_TABLE_NAME) # Read region info # FIXME: fail gracefully if can't find the region