Examples of JedisPoolConfig


Examples of redis.clients.jedis.JedisPoolConfig

  }
    }

    @Test
    public void returnNullObjectShouldNotFail() {
  JedisPool pool = new JedisPool(new JedisPoolConfig(), hnp.getHost(),
    hnp.getPort(), 2000, "foobared", 0, "my_shiny_client_name");

  pool.returnBrokenResource(null);
  pool.returnResource(null);
  pool.returnResourceObject(null);
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  pool.returnResourceObject(null);
    }

    @Test
    public void getNumActiveIsNegativeWhenPoolIsClosed() {
  JedisPool pool = new JedisPool(new JedisPoolConfig(), hnp.getHost(),
    hnp.getPort(), 2000, "foobared", 0, "my_shiny_client_name");

  pool.destroy();
  assertTrue(pool.getNumActive() < 0);
    }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  assertTrue(pool.getNumActive() < 0);
    }

    @Test
    public void getNumActiveReturnsTheCorrectNumber() {
  JedisPool pool = new JedisPool(new JedisPoolConfig(), hnp.getHost(),
    hnp.getPort(), 2000);
  Jedis jedis = pool.getResource();
  jedis.auth("foobared");
  jedis.set("foo", "bar");
  assertEquals("bar", jedis.get("foo"));
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  protected int redisTimeout = Protocol.DEFAULT_TIMEOUT;
  protected JedisPool redisConnectionPool;

  private void initializeJedisConnectionPool() {
    try {
      redisConnectionPool = new JedisPool(new JedisPoolConfig(), redisHost, redisPort, redisTimeout, redisPassword);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

public class RedisTaskResultStore implements TaskResultStore {
  private JedisPool _jedisPool;

  public RedisTaskResultStore(String redisServer, int redisPort, int timeout) {
    _jedisPool = new JedisPool(new JedisPoolConfig(), redisServer, redisPort, timeout);
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

        super.setProperty(property);
    }
   
    @Override
    public void testStarted(String distributedHost) {
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxActive(getMaxActive());
        config.setMaxIdle(getMaxIdle());
        config.setMinIdle(getMinIdle());
        config.setMaxWait(getMaxWait());
        config.setWhenExhaustedAction((byte)getWhenExhaustedAction());
        config.setTestOnBorrow(getTestOnBorrow());
        config.setTestOnReturn(getTestOnReturn());
        config.setTestWhileIdle(getTestWhileIdle());
        config.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis());
        config.setNumTestsPerEvictionRun(getNumTestsPerEvictionRun());
        config.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis());
        config.setSoftMinEvictableIdleTimeMillis(getSoftMinEvictableIdleTimeMillis());

        int port = Protocol.DEFAULT_PORT;
        if(!JOrphanUtils.isBlank(this.port)) {
            port = Integer.parseInt(this.port);
        }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

        int port = config.port().get() == null ? Protocol.DEFAULT_PORT : config.port().get();
        int timeout = config.timeout().get() == null ? Protocol.DEFAULT_TIMEOUT : config.timeout().get();
        String password = config.password().get();
        int database = config.database().get() == null ? Protocol.DEFAULT_DATABASE : config.database().get();

        pool = new JedisPool( new JedisPoolConfig(), host, port, timeout, password, database );
    }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

  public void start() {
    if(logger.isInfoEnabled()) logger.info("Starting Redis River stream");

    // Next, we'll try to connect our redis pool
    try {
      this.jedisPool = new JedisPool(new JedisPoolConfig(), this.redisHost, this.redisPort, 0, this.redisPsw, this.redisDB);
    } catch (Exception e) {
      // We can't connect to redis for some reason, so
      // let's not even try to finish this.
      logger.error("Unable to allocate redis pool. Disabling River.");
      return;
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

public class RedisTaskResultStore implements TaskResultStore {
  private JedisPool _jedisPool;

  public RedisTaskResultStore(String redisServer, int redisPort, int timeout) {
    _jedisPool = new JedisPool(new JedisPoolConfig(), redisServer,
        redisPort, timeout);
  }
View Full Code Here

Examples of redis.clients.jedis.JedisPoolConfig

    private static final String SET_PREFIX = "set_";

    private static final String ITEM_PREFIX = "item_";

    public RedisScheduler(String host) {
        this(new JedisPool(new JedisPoolConfig(), host));
    }
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.