hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-12595 Use Connection.getTable() in table.rb (Solomon Duskis)
Date Sat, 29 Nov 2014 20:52:55 GMT
Repository: hbase
Updated Branches:
  refs/heads/master b94b0e9ca -> 5985b4859


HBASE-12595 Use Connection.getTable() in table.rb (Solomon Duskis)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5985b485
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5985b485
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5985b485

Branch: refs/heads/master
Commit: 5985b485943e4664b83fad2f2cfd089e6031b062
Parents: b94b0e9
Author: stack <stack@apache.org>
Authored: Sat Nov 29 12:52:44 2014 -0800
Committer: stack <stack@apache.org>
Committed: Sat Nov 29 12:52:44 2014 -0800

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/table.rb | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5985b485/hbase-shell/src/main/ruby/hbase/table.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/table.rb b/hbase-shell/src/main/ruby/hbase/table.rb
index 1d43bd1..46aca19 100644
--- a/hbase-shell/src/main/ruby/hbase/table.rb
+++ b/hbase-shell/src/main/ruby/hbase/table.rb
@@ -112,26 +112,14 @@ EOF
     attr_reader :name
 
     def initialize(configuration, table_name, shell)
-      # Commenting out the HTable.new() calls and uncommenting the @connection approach causes
-      # Zookeepr exceptions.  Interestingly, there were changes in admin.rb to convert 
-      # HBaseAdmin.new() calls to ConnectionFactory.createConnection().getAdmin().  Either
change
-      # of ConnectionFactory.createConnection().getTable() or
-      # ConnectionFactory.createConnection().getAdmin() by itself doesn't cause the Zookeper

-      # exception.  Somehow the combination of the two causes the issue.
-
-      # TODO: Uncomment the createConnection approach after the underlying problem is fixed.
- 
       if @@thread_pool then
-        @table = org.apache.hadoop.hbase.client.HTable.new(configuration, table_name.to_java_bytes,
-          @@thread_pool)
-        # @connection = org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(
-        #  configuration, @@thread_pool)
-        # @table = @connection.getTable(table_name)
+        @connection = org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(
+          configuration, @@thread_pool)
+        @table = @connection.getTable(table_name)
       else
-        # @connection = org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(
-        #  configuration)
-        # @table = @connection.getTable(table_name)
-        @table = org.apache.hadoop.hbase.client.HTable.new(configuration, table_name)
+        @connection = org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(
+          configuration)
+        @table = @connection.getTable(table_name)
         @@thread_pool = @table.getPool()
       end
       


Mime
View raw message