在memcached中的连接池,是com.schooner.MemCached.SchoonerSockIOPool
在SchoonerSockIOPool中,
// store instances of pools
private static ConcurrentMap pools = new ConcurrentHashMap();
pools保存目前所有SchoonerSockIOPool,是个ConcurrentMap对象;key=poolName,value=Pool;
缺省的名字叫做default;
在设置好服务器后,需要调用初始化函数:
/**
* Initializes the pool.
*/
public void initialize() {
initDeadLock.lock();
try {
// if servers is not set, or it empty, then
// throw a runtime exception
if (servers == null || servers.length <= 0) {
log.error("++++ trying to initialize with no servers");
throw new IllegalStateException("++++ trying to initialize with no servers");
}
// pools