hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1154044 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java src/main/java/org/apache/hadoop/hbase/util/PoolMap.java src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java
Date Thu, 04 Aug 2011 22:58:44 GMT
Author: garyh
Date: Thu Aug  4 22:58:43 2011
New Revision: 1154044

URL: http://svn.apache.org/viewvc?rev=1154044&view=rev
Log:
HBASE-4150  Don't enforce pool size limit with ThreadLocalPool

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1154044&r1=1154043&r2=1154044&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Aug  4 22:58:43 2011
@@ -185,6 +185,8 @@ Release 0.91.0 - Unreleased
    HBASE-4148  HFileOutputFormat doesn't fill in TIMERANGE_KEY metadata (Jonathan Hsieh)
    HBASE-4003  Cleanup Calls Conservatively On Timeout (Karthick)
    HBASE-3857  Fix TestHFileBlock.testBlockHeapSize test failure (Mikhail)
+   HBASE-4150  Don't enforce pool size limit with ThreadLocalPool
+               (Karthick Sankarachary via garyh)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1154044&r1=1154043&r2=1154044&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Thu Aug  4 22:58:43
2011
@@ -761,11 +761,11 @@ public class HBaseClient {
 
   /**
    * Return the pool type specified in the configuration, if it roughly equals either
-   * the name of {@link PoolType#Reusable} or {@link PoolType#ThreadLocal}, otherwise
+   * the name of {@link PoolType#RoundRobin} or {@link PoolType#ThreadLocal}, otherwise
    * default to the former type.
    *
    * @param config configuration
-   * @return either a {@link PoolType#Reusable} or {@link PoolType#ThreadLocal}
+   * @return either a {@link PoolType#RoundRobin} or {@link PoolType#ThreadLocal}
    */
   private static PoolType getPoolType(Configuration config) {
     return PoolType.valueOf(config.get(HConstants.HBASE_CLIENT_IPC_POOL_TYPE),

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java?rev=1154044&r1=1154043&r2=1154044&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java Thu Aug  4 22:58:43
2011
@@ -396,9 +396,6 @@ public class PoolMap<K, V> implements Ma
         if (poolSize == null) {
           poolSizes.put(this, poolSize = new AtomicInteger(0));
         }
-        if (poolSize.intValue() >= maxSize) {
-          return null;
-        }
         poolSize.incrementAndGet();
       }
       this.set(resource);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java?rev=1154044&r1=1154043&r2=1154044&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPoolMap.java Thu Aug  4 22:58:43
2011
@@ -165,13 +165,10 @@ public class TestPoolMap {
       String randomKey = String.valueOf(random.nextInt());
       for (int i = 0; i < POOL_SIZE * 2; i++) {
         String randomValue = String.valueOf(random.nextInt());
-        if (i < POOL_SIZE) {
+        // as of HBASE-4150, pool limit is no longer used with ThreadLocalPool
           runThread(randomKey, randomValue, randomValue);
-        } else {
-          // When the pool fills up, we should not be able to put any new values
-          runThread(randomKey, randomValue, null);
-        }
       }
+      assertEquals(POOL_SIZE * 2, poolMap.size(randomKey));
     }
 
   }



Mime
View raw message