Examples of JedisPoolConfig


Examples of redis.clients.jedis.JedisPoolConfig

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

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

    verify(connectionFactory, times(1)).createRedisPool();
    verify(connectionFactory, never()).createRedisSentinelPool(Matchers.any(RedisSentinelConfiguration.class));
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  }

  @Test
  public void testClosePool() {

    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(1);
    config.setMaxIdle(1);

    JedisConnectionFactory factory2 = new JedisConnectionFactory(config);
    factory2.setHostName(SettingsUtils.getHost());
    factory2.setPort(SettingsUtils.getPort());
    factory2.afterPropertiesSet();
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  }

  @Test
  public void testPoolNPE() {

    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(1);

    JedisConnectionFactory factory2 = new JedisConnectionFactory(config);
    factory2.setUsePool(true);
    factory2.setHostName(SettingsUtils.getHost());
    factory2.setPort(SettingsUtils.getPort());
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  @Test
  // DATAREDIS-213 - Verify connection returns to pool after select
  public void testClosePoolPipelinedDbSelect() {

    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(1);
    config.setMaxIdle(1);
    JedisConnectionFactory factory2 = new JedisConnectionFactory(config);
    factory2.setHostName(SettingsUtils.getHost());
    factory2.setPort(SettingsUtils.getPort());
    factory2.setDatabase(1);
    factory2.afterPropertiesSet();
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

   * @param poolConfig pool configuration. Defaulted to new instance if {@literal null}.
   * @since 1.4
   */
  public JedisConnectionFactory(RedisSentinelConfiguration sentinelConfig, JedisPoolConfig poolConfig) {
    this.sentinelConfig = sentinelConfig;
    this.poolConfig = poolConfig != null ? poolConfig : new JedisPoolConfig();
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

   * @return
   * @since 1.4
   */
  protected Pool<Jedis> createRedisSentinelPool(RedisSentinelConfiguration config) {
    return new JedisSentinelPool(config.getMaster().getName(), convertToJedisSentinelSet(config.getSentinels()),
        getPoolConfig() != null ? getPoolConfig() : new JedisPoolConfig(), getShardInfo().getTimeout(), getShardInfo()
            .getPassword());
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

      return;
    }
    synchronized (this) {
      assert _jedisPool == null;
      s_logger.info("Connecting to {}:{}. Write-through set to: {}", new Object[] {getServer(), getPort(), _writeThrough});
      JedisPoolConfig poolConfig = new JedisPoolConfig();
      //poolConfig.set...
      JedisPool pool = new JedisPool(poolConfig, getServer(), getPort());
      _jedisPool = pool;
     
      _isInitialized = true;
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

   * @param host the redis server host, not null
   * @param port the redis server port, not null
   * @param password the redis server password, may be null
   */
  public RedisConnector(final String name, final String host, final int port, String password) {
    this(name, host, port, password, new JedisPoolConfig());
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

      if (m.matches()) {
        String password = m.group(2);
        String host = m.group(3);
        String port = m.group(4);
        String channel = m.group(5);
        JedisPool pool = new JedisPool( new JedisPoolConfig(), host, Integer.parseInt(port), timeoutMS, password);
        Jedis connection = pool.getResource();
        long numClients = connection.publish(channel, message.getMessage());
        long timeTaken = System.currentTimeMillis() - startTime;
        logger.debug("event=send_redis endpoint=" + endpoint + " num_clients=" + numClients + " conn=new resp_ms=" + timeTaken);
        pool.returnResource(connection);
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

        log.debug("Host: " + host);
        log.debug("Port: " + port);
        log.debug("Timeout: " + timeout);
        log.trace("Password: " + password);

        JedisPoolConfig config = new JedisPoolConfig();
        return new JedisPool(config, host, port, timeout, password, database);
    }
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.