HBASE-4150 Don't enforce pool size limit with ThreadLocalPool
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1154044 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
180cf9afd9
commit
4b84ea5a0a
|
@ -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)
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -396,9 +396,6 @@ public class PoolMap<K, V> implements Map<K, V> {
|
|||
if (poolSize == null) {
|
||||
poolSizes.put(this, poolSize = new AtomicInteger(0));
|
||||
}
|
||||
if (poolSize.intValue() >= maxSize) {
|
||||
return null;
|
||||
}
|
||||
poolSize.incrementAndGet();
|
||||
}
|
||||
this.set(resource);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue