hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
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 GMT
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 <yuzhihong@gmail.com>
Authored: Thu Feb 26 07:07:19 2015 -0800
Committer: tedyu <yuzhihong@gmail.com>
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


Mime
View raw message