Examples of JedisPoolConfig


Examples of redis.clients.jedis.JedisPoolConfig

      JedisPoolConfig masterPoolConfig) {
    // sentinelAddresses
    assertArgument(((sentinelAddresses == null) || (sentinelAddresses.length == 0)), "seintinelInfos is not set");

    for (HostAndPort sentinelInfo : sentinelAddresses) {
      JedisPool sentinelPool = new JedisDirectPool(sentinelInfo, new JedisPoolConfig());
      sentinelPools.add(sentinelPool);
    }

    // masterConnectionInfo
    assertArgument(masterConnectionInfo == null, "masterConnectionInfo is not set");
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

    if (poolSize < 1) {
      throw new IllegalArgumentException("poolSize is less then one");
    }

    JedisPoolConfig config = JedisPool.createPoolConfig(poolSize);
    ConnectionInfo connectionInfo = new ConnectionInfo(database, password, timeout);

    if (isDirect(masterName)) {
      return buildDirectPool(masterName, connectionInfo, config);
    } else {
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

    if (poolSize < 1) {
      throw new IllegalArgumentException("poolSize is less then one");
    }

    JedisPoolConfig config = JedisPool.createPoolConfig(poolSize);
    ConnectionInfo connectionInfo = new ConnectionInfo(database, password, timeout);

    List<JedisPool> jedisPools = new ArrayList<JedisPool>();

    if (isDirect(shardedMasterNames[0])) {
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

   * Also reset the idle checking time to 10 minutes, the default value is half minute.
   * Also rest the max idle to zero, the default value is 8 too.
   * The default idle time is 60 seconds.
   */
  public static JedisPoolConfig createPoolConfig(int maxPoolSize) {
    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(maxPoolSize);
    config.setMaxIdle(maxPoolSize);

    config.setTimeBetweenEvictionRunsMillis(600 * 1000);

    return config;
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

        return new JedisPool(createJedisPoolConfig(), host, port, timeout, password, database);
    }

    private static JedisPoolConfig createJedisPoolConfig() {
        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxTotal(256);
        poolConfig.setMinIdle(2);
        return poolConfig;
    }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

    private final Logger logger = LoggerFactory.getLogger(RedisDataStore.class);
    private final static Charset UTF_8 = Charset.forName("UTF-8");
    private final JedisPool jedisPool;

    public RedisDataStore(final String host, final int port) {
        jedisPool = new JedisPool(new JedisPoolConfig(), host, port);
    }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

      }
      return new JedisConnectionFactory(getSentinelConfig());
    }

    private JedisPoolConfig jedisPoolConfig() {
      JedisPoolConfig config = new JedisPoolConfig();
      RedisProperties.Pool props = this.properties.getPool();
      config.setMaxTotal(props.getMaxActive());
      config.setMaxIdle(props.getMaxIdle());
      config.setMinIdle(props.getMinIdle());
      config.setMaxWaitMillis(props.getMaxWait());
      return config;
    }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

        if (txTimeOut == null)
        {
            txTimeOut = props.getProperty(PersistenceProperties.KUNDERA_TRANSACTION_TIMEOUT);
        }

        JedisPoolConfig poolConfig = onPoolConfig(WHEN_EXHAUSTED_FAIL, maxActivePerNode, maxIdlePerNode,
                minIdlePerNode, maxTotal);
       

        JedisPool pool = null;
        onValidation(contactNode, defaultPort);
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

    {
        if (!StringUtils.isBlank(maxActivePerNode) && StringUtils.isNumeric(maxActivePerNode))
        {
            logger.info("configuring connection pool");

            JedisPoolConfig poolConfig = new JedisPoolConfig();

            if (maxActivePerNode != null && StringUtils.isNumeric(maxActivePerNode))
            {
                poolConfig.setMaxActive(Integer.valueOf(maxActivePerNode));
            }

            if (maxIdlePerNode != null && StringUtils.isNumeric(maxIdlePerNode))
            {
                poolConfig.setMaxIdle(Integer.valueOf(maxIdlePerNode));
            }
            if (minIdlePerNode != null && StringUtils.isNumeric(minIdlePerNode))
            {
                poolConfig.setMinIdle(Integer.parseInt(minIdlePerNode));
            }
            if (maxActivePerNode != null && StringUtils.isNumeric(maxActivePerNode))
            {
                poolConfig.setWhenExhaustedAction(WHEN_EXHAUSTED_FAIL);
            }
            return poolConfig;
        }

        return null;
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

   * @see DATAREDIS-324
   */
  @Test
  public void shouldInitSentinelPoolWhenSentinelConfigPresent() {

    connectionFactory = initSpyedConnectionFactory(SINGLE_SENTINEL_CONFIG, new JedisPoolConfig());
    connectionFactory.afterPropertiesSet();

    verify(connectionFactory, times(1)).createRedisSentinelPool(Matchers.eq(SINGLE_SENTINEL_CONFIG));
    verify(connectionFactory, never()).createRedisPool();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.