// Path: src/main/java/org/darkphoenixs/pool/ConnectionPool.java
// public interface ConnectionPool<T> extends Serializable {
// 
//     /**
//      * <p>Title: getConnection</p>
//      * <p>Description: 获取连接</p>
//      *
//      * @return 连接
//      */
//     public abstract T getConnection();
// 
//     /**
//      * <p>Title: returnConnection</p>
//      * <p>Description: 返回连接</p>
//      *
//      * @param conn 连接
//      */
//     public void returnConnection(T conn);
// 
//     /**
//      * <p>Title: invalidateConnection</p>
//      * <p>Description: 废弃连接</p>
//      *
//      * @param conn 连接
//      */
//     public void invalidateConnection(T conn);
// }
// 
// Path: src/main/java/org/darkphoenixs/pool/PoolConfig.java
// public class PoolConfig extends GenericObjectPoolConfig implements Serializable {
// 
//     /**
//      * DEFAULT_TEST_WHILE_IDLE
//      */
//     public static final boolean DEFAULT_TEST_WHILE_IDLE = true;
//     /**
//      * DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
//      */
//     public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 60000;
//     /**
//      * DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
//      */
//     public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 30000;
//     /**
//      * DEFAULT_NUM_TESTS_PER_EVICTION_RUN
//      */
//     public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = -1;
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = -2414567557372345057L;
// 
//     /**
//      * <p>Title: PoolConfig</p>
//      * <p>Description: 默认构造方法</p>
//      */
//     public PoolConfig() {
// 
//         // defaults to make your life with connection pool easier :)
//         setTestWhileIdle(DEFAULT_TEST_WHILE_IDLE);
//         setMinEvictableIdleTimeMillis(DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
//         setTimeBetweenEvictionRunsMillis(DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
//         setNumTestsPerEvictionRun(DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
//     }
// }


import org.darkphoenixs.pool.ConnectionPool;
import org.darkphoenixs.pool.PoolConfig;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
package org.darkphoenixs.pool.redis;



/**
 * <p>Title: RedisSentinelConnPool</p>
 * <p>Description: Redis哨兵连接池</p>
 *
 * @author Victor.Zxy
 * @version 1.2.3
 * @see ConnectionPool
 * @since 2016 /8/25
 */
public class RedisSentinelConnPool implements ConnectionPool<Jedis> {

    private final JedisSentinelPool pool;

    /**
     * Instantiates a new Redis sentinel conn pool(For test).
     *
     * @param pool the pool
     */
    protected RedisSentinelConnPool(final JedisSentinelPool pool) {
        this.pool = pool;
    }

    /**
     * Instantiates a new Redis sentinel conn pool.
     *
     * @param masterName the master name
     * @param sentinels  the sentinels
     */
    public RedisSentinelConnPool(final String masterName, final Set<String> sentinels) {

// Path: src/main/java/org/darkphoenixs/pool/ConnectionPool.java
// public interface ConnectionPool<T> extends Serializable {
// 
//     /**
//      * <p>Title: getConnection</p>
//      * <p>Description: 获取连接</p>
//      *
//      * @return 连接
//      */
//     public abstract T getConnection();
// 
//     /**
//      * <p>Title: returnConnection</p>
//      * <p>Description: 返回连接</p>
//      *
//      * @param conn 连接
//      */
//     public void returnConnection(T conn);
// 
//     /**
//      * <p>Title: invalidateConnection</p>
//      * <p>Description: 废弃连接</p>
//      *
//      * @param conn 连接
//      */
//     public void invalidateConnection(T conn);
// }
// 
// Path: src/main/java/org/darkphoenixs/pool/PoolConfig.java
// public class PoolConfig extends GenericObjectPoolConfig implements Serializable {
// 
//     /**
//      * DEFAULT_TEST_WHILE_IDLE
//      */
//     public static final boolean DEFAULT_TEST_WHILE_IDLE = true;
//     /**
//      * DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
//      */
//     public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 60000;
//     /**
//      * DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
//      */
//     public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 30000;
//     /**
//      * DEFAULT_NUM_TESTS_PER_EVICTION_RUN
//      */
//     public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = -1;
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = -2414567557372345057L;
// 
//     /**
//      * <p>Title: PoolConfig</p>
//      * <p>Description: 默认构造方法</p>
//      */
//     public PoolConfig() {
// 
//         // defaults to make your life with connection pool easier :)
//         setTestWhileIdle(DEFAULT_TEST_WHILE_IDLE);
//         setMinEvictableIdleTimeMillis(DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
//         setTimeBetweenEvictionRunsMillis(DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
//         setNumTestsPerEvictionRun(DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
//     }
// }


// Path: src/main/java/org/darkphoenixs/pool/redis/RedisSentinelConnPool.java
import org.darkphoenixs.pool.ConnectionPool;
import org.darkphoenixs.pool.PoolConfig;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;

package org.darkphoenixs.pool.redis;



/**
 * <p>Title: RedisSentinelConnPool</p>
 * <p>Description: Redis哨兵连接池</p>
 *
 * @author Victor.Zxy
 * @version 1.2.3
 * @see ConnectionPool
 * @since 2016 /8/25
 */
public class RedisSentinelConnPool implements ConnectionPool<Jedis> {

    private final JedisSentinelPool pool;

    /**
     * Instantiates a new Redis sentinel conn pool(For test).
     *
     * @param pool the pool
     */
    protected RedisSentinelConnPool(final JedisSentinelPool pool) {
        this.pool = pool;
    }

    /**
     * Instantiates a new Redis sentinel conn pool.
     *
     * @param masterName the master name
     * @param sentinels  the sentinels
     */
    public RedisSentinelConnPool(final String masterName, final Set<String> sentinels) {

        this(new PoolConfig(), masterName, sentinels);