Java Code Examples for org.apache.commons.pool2.impl.GenericObjectPoolConfig#setSoftMinEvictableIdleTimeMillis()

The following examples show how to use org.apache.commons.pool2.impl.GenericObjectPoolConfig#setSoftMinEvictableIdleTimeMillis() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: J2CacheSpringRedisAutoConfiguration.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 6 votes vote down vote up
private GenericObjectPoolConfig getGenericRedisPool(Properties props, String prefix) {
    GenericObjectPoolConfig cfg = new GenericObjectPoolConfig();
    cfg.setMaxTotal(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxTotal"), "-1")));
    cfg.setMaxIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxIdle"), "100")));
    cfg.setMaxWaitMillis(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxWaitMillis"), "100")));
    cfg.setMinEvictableIdleTimeMillis(
        Integer.valueOf((String) props.getOrDefault(key(prefix, "minEvictableIdleTimeMillis"), "864000000")));
    cfg.setMinIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "minIdle"), "10")));
    cfg.setNumTestsPerEvictionRun(
        Integer.valueOf((String) props.getOrDefault(key(prefix, "numTestsPerEvictionRun"), "10")));
    cfg.setLifo(Boolean.valueOf(props.getProperty(key(prefix, "lifo"), "false")));
    cfg.setSoftMinEvictableIdleTimeMillis(
        Integer.valueOf((String) props.getOrDefault(key(prefix, "softMinEvictableIdleTimeMillis"), "10")));
    cfg.setTestOnBorrow(Boolean.valueOf(props.getProperty(key(prefix, "testOnBorrow"), "true")));
    cfg.setTestOnReturn(Boolean.valueOf(props.getProperty(key(prefix, "testOnReturn"), "false")));
    cfg.setTestWhileIdle(Boolean.valueOf(props.getProperty(key(prefix, "testWhileIdle"), "true")));
    cfg.setTimeBetweenEvictionRunsMillis(
        Integer.valueOf((String) props.getOrDefault(key(prefix, "timeBetweenEvictionRunsMillis"), "300000")));
    cfg.setBlockWhenExhausted(Boolean.valueOf(props.getProperty(key(prefix, "blockWhenExhausted"), "false")));
    return cfg;
}
 
Example 2
Source File: J2CacheRedisAutoConfiguration.java    From Aooms with Apache License 2.0 6 votes vote down vote up
private GenericObjectPoolConfig getGenericRedisPool(Properties props, String prefix) {
	GenericObjectPoolConfig cfg = new GenericObjectPoolConfig();
	cfg.setMaxTotal(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxTotal"), "-1")));
	cfg.setMaxIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxIdle"), "100")));
	cfg.setMaxWaitMillis(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxWaitMillis"), "100")));
	cfg.setMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "minEvictableIdleTimeMillis"), "864000000")));
	cfg.setMinIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "minIdle"), "10")));
	cfg.setNumTestsPerEvictionRun(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "numTestsPerEvictionRun"), "10")));
	cfg.setLifo(Boolean.valueOf(props.getProperty(key(prefix, "lifo"), "false")));
	cfg.setSoftMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "softMinEvictableIdleTimeMillis"), "10")));
	cfg.setTestOnBorrow(Boolean.valueOf(props.getProperty(key(prefix, "testOnBorrow"), "true")));
	cfg.setTestOnReturn(Boolean.valueOf(props.getProperty(key(prefix, "testOnReturn"), "false")));
	cfg.setTestWhileIdle(Boolean.valueOf(props.getProperty(key(prefix, "testWhileIdle"), "true")));
	cfg.setTimeBetweenEvictionRunsMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "timeBetweenEvictionRunsMillis"), "300000")));
	cfg.setBlockWhenExhausted(Boolean.valueOf(props.getProperty(key(prefix, "blockWhenExhausted"), "false")));
	return cfg;
}
 
Example 3
Source File: J2CacheSpringRedisAutoConfiguration.java    From J2Cache with Apache License 2.0 6 votes vote down vote up
private GenericObjectPoolConfig getGenericRedisPool(Properties props, String prefix) {
	GenericObjectPoolConfig cfg = new GenericObjectPoolConfig();
	cfg.setMaxTotal(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxTotal"), "-1")));
	cfg.setMaxIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxIdle"), "100")));
	cfg.setMaxWaitMillis(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxWaitMillis"), "100")));
	cfg.setMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "minEvictableIdleTimeMillis"), "864000000")));
	cfg.setMinIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "minIdle"), "10")));
	cfg.setNumTestsPerEvictionRun(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "numTestsPerEvictionRun"), "10")));
	cfg.setLifo(Boolean.valueOf(props.getProperty(key(prefix, "lifo"), "false")));
	cfg.setSoftMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "softMinEvictableIdleTimeMillis"), "10")));
	cfg.setTestOnBorrow(Boolean.valueOf(props.getProperty(key(prefix, "testOnBorrow"), "true")));
	cfg.setTestOnReturn(Boolean.valueOf(props.getProperty(key(prefix, "testOnReturn"), "false")));
	cfg.setTestWhileIdle(Boolean.valueOf(props.getProperty(key(prefix, "testWhileIdle"), "true")));
	cfg.setTimeBetweenEvictionRunsMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "timeBetweenEvictionRunsMillis"), "300000")));
	cfg.setBlockWhenExhausted(Boolean.valueOf(props.getProperty(key(prefix, "blockWhenExhausted"), "false")));
	return cfg;
}
 
Example 4
Source File: JedisHolder.java    From feeyo-redisproxy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private JedisPool initialize(String host, int port) {

		GenericObjectPoolConfig jedisPoolConfig = new GenericObjectPoolConfig();
		jedisPoolConfig.setMaxIdle(maxIdle);
		jedisPoolConfig.setMinIdle(minIdle);
		jedisPoolConfig.setTestOnBorrow(testOnBorrow);
		jedisPoolConfig.setTestOnReturn(testOnReturn);
		jedisPoolConfig.setTestWhileIdle(testWhileIdle);

		jedisPoolConfig.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
		jedisPoolConfig.setMinEvictableIdleTimeMillis(-1);
		jedisPoolConfig.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
		jedisPoolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);

		return new JedisPool(jedisPoolConfig, host, port, timeBetweenEvictionRunsMillis, null);
		
	}
 
Example 5
Source File: ObjectPoolFactory.java    From Thunder with Apache License 2.0 6 votes vote down vote up
public static GenericObjectPoolConfig createFSTObjectPoolConfig() {
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    try {
        config.setMaxTotal(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.FST_OBJECT_POOL_MAX_TOTAL_ATTRIBUTE_NAME));
        config.setMaxIdle(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.FST_OBJECT_POOL_MAX_IDLE_ATTRIBUTE_NAME));
        config.setMinIdle(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.FST_OBJECT_POOL_MIN_IDLE_ATTRIBUTE_NAME));
        config.setMaxWaitMillis(properties.getLong(ThunderConstant.FST_OBJECT_POOL_MAX_WAIT_MILLIS_ATTRIBUTE_NAME));
        config.setTimeBetweenEvictionRunsMillis(properties.getLong(ThunderConstant.FST_OBJECT_POOL_TIME_BETWEEN_EVICTION_RUN_MILLIS_ATTRIBUTE_NAME));
        config.setMinEvictableIdleTimeMillis(properties.getLong(ThunderConstant.FST_OBJECT_POOL_MIN_EVICTABLE_IDLE_TIME_MILLIS_ATTRIBUTE_NAME));
        config.setSoftMinEvictableIdleTimeMillis(properties.getLong(ThunderConstant.FST_OBJECT_POOL_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS_ATTRIBUTE_NAME));
        config.setBlockWhenExhausted(properties.getBoolean(ThunderConstant.FST_OBJECT_POOL_BLOCK_WHEN_EXHAUSTED_ATTRIBUTE_NAME));
        config.setLifo(properties.getBoolean(ThunderConstant.FST_OBJECT_POOL_LIFO_ATTRIBUTE_NAME));
        config.setFairness(properties.getBoolean(ThunderConstant.FST_OBJECT_POOL_FAIRNESS_ATTRIBUTE_NAME));
        config.setTestOnBorrow(false);
        config.setTestOnReturn(false);
        config.setTestOnCreate(false);
        config.setTestWhileIdle(false);
        config.setNumTestsPerEvictionRun(-1);
    } catch (Exception e) {
        throw new IllegalArgumentException("Properties maybe isn't initialized");
    }

    return config;
}
 
Example 6
Source File: ObjectPoolFactory.java    From Thunder with Apache License 2.0 6 votes vote down vote up
public static GenericObjectPoolConfig createRedisObjectPoolConfig() {
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    try {
        config.setMaxTotal(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.REDIS_OBJECT_POOL_MAX_TOTAL_ATTRIBUTE_NAME));
        config.setMaxIdle(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.REDIS_OBJECT_POOL_MAX_IDLE_ATTRIBUTE_NAME));
        config.setMinIdle(ThunderConstant.CPUS * properties.getInteger(ThunderConstant.REDIS_OBJECT_POOL_MIN_IDLE_ATTRIBUTE_NAME));
        config.setMaxWaitMillis(properties.getLong(ThunderConstant.REDIS_OBJECT_POOL_MAX_WAIT_MILLIS_ATTRIBUTE_NAME));
        config.setTimeBetweenEvictionRunsMillis(properties.getLong(ThunderConstant.REDIS_OBJECT_POOL_TIME_BETWEEN_EVICTION_RUN_MILLIS_ATTRIBUTE_NAME));
        config.setMinEvictableIdleTimeMillis(properties.getLong(ThunderConstant.REDIS_OBJECT_POOL_MIN_EVICTABLE_IDLE_TIME_MILLIS_ATTRIBUTE_NAME));
        config.setSoftMinEvictableIdleTimeMillis(properties.getLong(ThunderConstant.REDIS_OBJECT_POOL_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS_ATTRIBUTE_NAME));
        config.setBlockWhenExhausted(properties.getBoolean(ThunderConstant.REDIS_OBJECT_POOL_BLOCK_WHEN_EXHAUSTED_ATTRIBUTE_NAME));
        config.setLifo(properties.getBoolean(ThunderConstant.REDIS_OBJECT_POOL_LIFO_ATTRIBUTE_NAME));
        config.setFairness(properties.getBoolean(ThunderConstant.REDIS_OBJECT_POOL_FAIRNESS_ATTRIBUTE_NAME));
        config.setTestOnBorrow(false);
        config.setTestOnReturn(false);
        config.setTestOnCreate(false);
        config.setTestWhileIdle(false);
        config.setNumTestsPerEvictionRun(-1);
    } catch (Exception e) {
        throw new IllegalArgumentException("Properties maybe isn't initialized");
    }

    return config;
}
 
Example 7
Source File: JedisManager.java    From game-server with MIT License 5 votes vote down vote up
public JedisManager(JedisClusterConfig config) {
	HashSet<HostAndPort> jedisClusterNodes = new HashSet<>();
	config.getNodes().forEach(node -> {
		if (node == null) {
			return;
		}
		try {
			if (node.getIp() != null && node.getIp().length() > 5) {
				jedisClusterNodes.add(new HostAndPort(node.getIp(), node.getPort()));
			}
		} catch (Exception e) {
			LOGGER.error(node.toString(), e);
		}
	});
	GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
	poolConfig.setMaxTotal(config.getPoolMaxTotal());
	poolConfig.setMaxIdle(config.getPoolMaxIdle());
	poolConfig.setMaxWaitMillis(config.getMaxWaitMillis());
	poolConfig.setTimeBetweenEvictionRunsMillis(config.getTimeBetweenEvictionRunsMillis());
	poolConfig.setMinEvictableIdleTimeMillis(config.getMinEvictableIdleTimeMillis());
	poolConfig.setSoftMinEvictableIdleTimeMillis(config.getSoftMinEvictableIdleTimeMillis());
	poolConfig.setTestOnBorrow(config.isTestOnBorrow());
	poolConfig.setTestWhileIdle(config.isTestWhileIdle());
	poolConfig.setTestOnReturn(config.isTestOnReturn());
	jedisCluster = new JedisCluster(jedisClusterNodes, config.getConnectionTimeout(), config.getSoTimeout(),
			config.getMaxRedirections(), poolConfig);
}
 
Example 8
Source File: UpdateEventCacheService.java    From game-executor with Apache License 2.0 5 votes vote down vote up
public static void start(){
//        int size = 1024;
        int size = 1024;
        int max = 32;
        GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig();
        genericObjectPoolConfig.setMaxTotal(size * max);
        genericObjectPoolConfig.setMaxIdle(size * max);
        genericObjectPoolConfig.setMinIdle(size);
        long time = 1000 * 30;
        genericObjectPoolConfig.setMaxWaitMillis(time);
        genericObjectPoolConfig.setSoftMinEvictableIdleTimeMillis(time);

        updateEventCacheFactory = new UpdateEventCacheFactory(new UpdateEventPoolFactory(), genericObjectPoolConfig);
    }
 
Example 9
Source File: DefaultConnectionProvider.java    From Openfire with Apache License 2.0 5 votes vote down vote up
@Override
public void start() {

    try {
        Class.forName(driver);
    } catch (final ClassNotFoundException e) {
        throw new RuntimeException("Unable to find JDBC driver " + driver, e);
    }

    final ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(serverURL, username, password);
    final PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, null);
    poolableConnectionFactory.setValidationQuery(testSQL);
    poolableConnectionFactory.setValidationQueryTimeout(testTimeout);
    poolableConnectionFactory.setMaxConnLifetimeMillis((long) (connectionTimeout * JiveConstants.DAY));

    final GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setTestOnBorrow(testBeforeUse);
    poolConfig.setTestOnReturn(testAfterUse);
    poolConfig.setMinIdle(minConnections);
    if( minConnections > GenericObjectPoolConfig.DEFAULT_MAX_IDLE )
    {
        poolConfig.setMaxIdle(minConnections);
    }
    poolConfig.setMaxTotal(maxConnections);
    poolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRuns);
    poolConfig.setSoftMinEvictableIdleTimeMillis(minIdleTime);
    poolConfig.setMaxWaitMillis(maxWaitTime);
    connectionPool = new GenericObjectPool<>(poolableConnectionFactory, poolConfig);
    poolableConnectionFactory.setPool(connectionPool);
    dataSource = new PoolingDataSource<>(connectionPool);
}
 
Example 10
Source File: DynamicJdbcIO.java    From DataflowTemplates with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
DataSource buildDatasource() {
  BasicDataSource basicDataSource = new BasicDataSource();
  if (getDriverClassName() != null) {
    if (getDriverClassName().get() == null) {
      throw new RuntimeException("Driver class name is required.");
    }
    basicDataSource.setDriverClassName(getDriverClassName().get());
  }
  if (getUrl() != null) {
    if (getUrl().get() == null) {
      throw new RuntimeException("Connection url is required.");
    }
    basicDataSource.setUrl(getUrl().get());
  }
  if (getUsername() != null) {
    basicDataSource.setUsername(getUsername().get());
  }
  if (getPassword() != null) {
    basicDataSource.setPassword(getPassword().get());
  }
  if (getConnectionProperties() != null && getConnectionProperties().get() != null) {
    basicDataSource.setConnectionProperties(getConnectionProperties().get());
  }

  /**
   * Since the jdbc connection connection class might have dependencies that are not available
   * to the template, we will localize the user provided dependencies from GCS and create a new
   * {@link URLClassLoader} that is added to the {@link
   * BasicDataSource#setDriverClassLoader(ClassLoader)}
   */
  if (getDriverJars() != null) {
    ClassLoader urlClassLoader = getNewClassLoader(getDriverJars());
    basicDataSource.setDriverClassLoader(urlClassLoader);
  }

  // wrapping the datasource as a pooling datasource
  DataSourceConnectionFactory connectionFactory =
      new DataSourceConnectionFactory(basicDataSource);
  PoolableConnectionFactory poolableConnectionFactory =
      new PoolableConnectionFactory(connectionFactory, null);
  GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
  poolConfig.setMaxTotal(1);
  poolConfig.setMinIdle(0);
  poolConfig.setMinEvictableIdleTimeMillis(10000);
  poolConfig.setSoftMinEvictableIdleTimeMillis(30000);
  GenericObjectPool connectionPool =
      new GenericObjectPool(poolableConnectionFactory, poolConfig);
  poolableConnectionFactory.setPool(connectionPool);
  poolableConnectionFactory.setDefaultAutoCommit(false);
  poolableConnectionFactory.setDefaultReadOnly(false);
  PoolingDataSource poolingDataSource = new PoolingDataSource(connectionPool);
  return poolingDataSource;
}
 
Example 11
Source File: DefaultRedisModuleCfg.java    From ymate-platform-v2 with Apache License 2.0 4 votes vote down vote up
private RedisDataSourceCfgMeta __doParserDataSourceCfgMeta(String dsName, Map<String, String> dataSourceCfgs) throws Exception {
    IConfigReader _dataSourceCfg = MapSafeConfigReader.bind(dataSourceCfgs);
    //
    IRedis.ConnectionType _connectionType;
    try {
        _connectionType = IRedis.ConnectionType.valueOf(_dataSourceCfg.getString(CONNECTION_TYPE, IConfig.DEFAULT_STR).toUpperCase());
    } catch (IllegalArgumentException e) {
        throw new UnsupportedOperationException("Redis connection type unsupported.");
    }
    String _masterServerName = _dataSourceCfg.getString(MASTER_SERVER_NAME, IConfig.DEFAULT_STR);
    List<ServerMeta> _servers = new ArrayList<ServerMeta>();
    String[] _serverNames = StringUtils.split(_dataSourceCfg.getString(SERVER_NAME_LIST, IConfig.DEFAULT_STR), "|");
    if (_serverNames != null) {
        for (String _serverName : _serverNames) {
            IConfigReader _serverCfg = MapSafeConfigReader.bind(_dataSourceCfg.getMap("server." + _serverName + "."));
            if (!_serverCfg.toMap().isEmpty()) {
                ServerMeta _servMeta = new ServerMeta();
                _servMeta.setName(_serverName);
                _servMeta.setHost(_serverCfg.getString(HOST, "localhost"));
                _servMeta.setPort(_serverCfg.getInt(PORT, 6379));
                _servMeta.setTimeout(_serverCfg.getInt(TIMEOUT, 2000));
                _servMeta.setSocketTimeout(_serverCfg.getInt(SOCKET_TIMEOUT, 2000));
                _servMeta.setMaxAttempts(_serverCfg.getInt(MAX_ATTEMPTS, 3));
                _servMeta.setWeight(_serverCfg.getInt(WEIGHT, 1));
                _servMeta.setDatabase(_serverCfg.getInt(DATABASE, 0));
                _servMeta.setClientName(_serverCfg.getString(CLIENT_NAME));
                _servMeta.setPassword(_serverCfg.getString(PASSWORD));
                //
                boolean _isPwdEncrypted = _dataSourceCfg.getBoolean(PASSWORD_ENCRYPTED);
                //
                if (_isPwdEncrypted && StringUtils.isNotBlank(_servMeta.getPassword())) {
                    IPasswordProcessor _proc = _serverCfg.getClassImpl(PASSWORD_CLASS, IPasswordProcessor.class);
                    if (_proc == null) {
                        _proc = __owner.getConfig().getDefaultPasswordClass().newInstance();
                    }
                    if (_proc != null) {
                        _servMeta.setPassword(_proc.decrypt(_servMeta.getPassword()));
                    }
                }
                //
                _servers.add(_servMeta);
            }
        }
    }
    //
    GenericObjectPoolConfig _poolConfig = new GenericObjectPoolConfig();
    IConfigReader _poolCfg = MapSafeConfigReader.bind(_dataSourceCfg.getMap("pool."));
    if (!_poolCfg.toMap().isEmpty()) {
        _poolConfig.setMinIdle(_poolCfg.getInt(MIN_IDLE, GenericObjectPoolConfig.DEFAULT_MIN_IDLE));
        _poolConfig.setMaxIdle(_poolCfg.getInt(MAX_IDLE, GenericObjectPoolConfig.DEFAULT_MAX_IDLE));
        _poolConfig.setMaxTotal(_poolCfg.getInt(MAX_TOTAL, GenericObjectPoolConfig.DEFAULT_MAX_TOTAL));
        _poolConfig.setBlockWhenExhausted(_poolCfg.getBoolean(BLOCK_WHEN_EXHAUSTED, GenericObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED));
        _poolConfig.setFairness(_poolCfg.getBoolean(FAIRNESS, GenericObjectPoolConfig.DEFAULT_FAIRNESS));
        _poolConfig.setJmxEnabled(_poolCfg.getBoolean(JMX_ENABLE, GenericObjectPoolConfig.DEFAULT_JMX_ENABLE));
        _poolConfig.setJmxNameBase(_poolCfg.getString(JMX_NAME_BASE, GenericObjectPoolConfig.DEFAULT_JMX_NAME_BASE));
        _poolConfig.setJmxNamePrefix(_poolCfg.getString(JMX_NAME_PREFIX, GenericObjectPoolConfig.DEFAULT_JMX_NAME_PREFIX));
        _poolConfig.setEvictionPolicyClassName(_poolCfg.getString(EVICTION_POLICY_CLASS_NAME, GenericObjectPoolConfig.DEFAULT_EVICTION_POLICY_CLASS_NAME));
        _poolConfig.setLifo(_poolCfg.getBoolean(LIFO, GenericObjectPoolConfig.DEFAULT_LIFO));
        _poolConfig.setMaxWaitMillis(_poolCfg.getLong(MAX_WAIT_MILLIS, GenericObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS));
        _poolConfig.setMinEvictableIdleTimeMillis(_poolCfg.getLong(MIN_EVICTABLE_IDLE_TIME_MILLIS, GenericObjectPoolConfig.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS));
        _poolConfig.setSoftMinEvictableIdleTimeMillis(_poolCfg.getLong(SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS, GenericObjectPoolConfig.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS));
        _poolConfig.setTestOnBorrow(_poolCfg.getBoolean(TEST_ON_BORROW, GenericObjectPoolConfig.DEFAULT_TEST_ON_BORROW));
        _poolConfig.setTestOnReturn(_poolCfg.getBoolean(TEST_ON_RETURN, GenericObjectPoolConfig.DEFAULT_TEST_ON_RETURN));
        _poolConfig.setTestOnCreate(_poolCfg.getBoolean(TEST_ON_CREATE, GenericObjectPoolConfig.DEFAULT_TEST_ON_CREATE));
        _poolConfig.setTestWhileIdle(_poolCfg.getBoolean(TEST_WHILE_IDLE, GenericObjectPoolConfig.DEFAULT_TEST_WHILE_IDLE));
        _poolConfig.setNumTestsPerEvictionRun(_poolCfg.getInt(NUM_TESTS_PER_EVICTION_RUN, GenericObjectPoolConfig.DEFAULT_NUM_TESTS_PER_EVICTION_RUN));
        _poolConfig.setTimeBetweenEvictionRunsMillis(_poolCfg.getLong(TIME_BETWEEN_EVICTION_RUNS_MILLIS, GenericObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS));
    }
    return new RedisDataSourceCfgMeta(dsName, _connectionType, _masterServerName, _servers, _poolConfig);
}