You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2013/07/18 23:01:58 UTC

svn commit: r1504659 - /hbase/branches/0.94/src/main/ruby/hbase/table.rb

Author: larsh
Date: Thu Jul 18 21:01:58 2013
New Revision: 1504659

URL: http://svn.apache.org/r1504659
Log:
HBASE-8988 Reuse the thread pool in the shell to not run out of threads (Jean-Daniel Cryans)

Modified:
    hbase/branches/0.94/src/main/ruby/hbase/table.rb

Modified: hbase/branches/0.94/src/main/ruby/hbase/table.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/ruby/hbase/table.rb?rev=1504659&r1=1504658&r2=1504659&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/ruby/hbase/table.rb (original)
+++ hbase/branches/0.94/src/main/ruby/hbase/table.rb Thu Jul 18 21:01:58 2013
@@ -26,9 +26,15 @@ module Hbase
   class Table
     include HBaseConstants
     attr_reader :table
+    @@thread_pool = nil
 
     def initialize(configuration, table_name, formatter)
-      @table = org.apache.hadoop.hbase.client.HTable.new(configuration, table_name)
+      if @@thread_pool then
+        @table = org.apache.hadoop.hbase.client.HTable.new(configuration, table_name.to_java_bytes, @@thread_pool)
+      else
+        @table = org.apache.hadoop.hbase.client.HTable.new(configuration, table_name)
+        @@thread_pool = @table.getPool()
+      end
     end
 
     #----------------------------------------------------------------------------------------------