hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1504659 - /hbase/branches/0.94/src/main/ruby/hbase/table.rb
Date Thu, 18 Jul 2013 21:01:58 GMT
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
 
     #----------------------------------------------------------------------------------------------



Mime
View raw message