Initial JedisSentinelPool based on code from hamsterready/jedis-sentinel-pool.
Given a master name and a set of sentinels this pool will subscribe to the Sentinel notifications about master changes (+switch-master) and re-establishes the pool to the new master when one is announced.
This commit is contained in:
@@ -14,14 +14,19 @@ public abstract class Pool<T> {
|
||||
* the internalPool yourself.
|
||||
*/
|
||||
public Pool() {
|
||||
this.internalPool = null;
|
||||
this.internalPool = null;
|
||||
}
|
||||
|
||||
public Pool(final GenericObjectPool.Config poolConfig,
|
||||
PoolableObjectFactory factory) {
|
||||
this.internalPool = new GenericObjectPool(factory, poolConfig);
|
||||
initPool(poolConfig, factory);
|
||||
}
|
||||
|
||||
|
||||
public void initPool(final GenericObjectPool.Config poolConfig,
|
||||
PoolableObjectFactory factory) {
|
||||
this.internalPool = new GenericObjectPool(factory, poolConfig);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T getResource() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user