Index: src/main/java/org/apache/hadoop/hbase/client/HTablePool.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (revision 995088) +++ src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (working copy) @@ -23,6 +23,8 @@ import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.util.Bytes; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; @@ -41,8 +43,8 @@ * is {@link Integer#MAX_VALUE}.

*/ public class HTablePool { - private final Map> tables = - Collections.synchronizedMap(new HashMap>()); + private final ConcurrentMap> tables = + new ConcurrentHashMap>(); private final Configuration config; private final int maxSize; private HTableInterfaceFactory tableFactory = new HTableFactory(); @@ -82,7 +84,7 @@ LinkedList queue = tables.get(tableName); if(queue == null) { queue = new LinkedList(); - tables.put(tableName, queue); + tables.putIfAbsent(tableName, queue); return createHTable(tableName); } HTableInterface table;