Package org.apache.commons.pool2.impl

Examples of org.apache.commons.pool2.impl.AbandonedConfig


  pool.destroy();
    }

    @Test
    public void checkResourceIsCloseable() throws URISyntaxException {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);

  List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
  shards.add(new JedisShardInfo(new URI(
    "redis://:foobared@localhost:6380")));
  shards.add(new JedisShardInfo(new URI(
View Full Code Here


  this(masterName, sentinels, poolConfig, Protocol.DEFAULT_TIMEOUT, null,
    Protocol.DEFAULT_DATABASE);
    }

    public JedisSentinelPool(String masterName, Set<String> sentinels) {
  this(masterName, sentinels, new GenericObjectPoolConfig(),
    Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE);
    }
View Full Code Here

    Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE);
    }

    public JedisSentinelPool(String masterName, Set<String> sentinels,
      String password) {
  this(masterName, sentinels, new GenericObjectPoolConfig(),
    Protocol.DEFAULT_TIMEOUT, password);
    }
View Full Code Here

  assertTrue(pool.isClosed());
    }

    @Test(expected = JedisConnectionException.class)
    public void checkPoolOverflow() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort());
  Jedis jedis = pool.getResource();
  jedis.auth("foobared");
  jedis.set("foo", "0");
View Full Code Here

  assertTrue(pool0.isClosed());
    }

    @Test
    public void returnResourceShouldResetState() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(),
    2000, "foobared");

  Jedis jedis = pool.getResource();
  try {
View Full Code Here

  assertTrue(pool.isClosed());
    }

    @Test
    public void checkResourceIsCloseable() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(1);
  config.setBlockWhenExhausted(false);
  JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(),
    2000, "foobared");

  Jedis jedis = pool.getResource();
  try {
View Full Code Here

    public JedisCluster(Set<HostAndPort> nodes) {
  this(nodes, DEFAULT_TIMEOUT);
    }

    public JedisCluster(Set<HostAndPort> nodes, int timeout, int maxRedirections) {
  this(nodes, timeout, maxRedirections, new GenericObjectPoolConfig());
    }
View Full Code Here

  assertEquals("foo", jc.get("51"));
    }

    @Test(expected = JedisConnectionException.class)
    public void testIfPoolConfigAppliesToClusterPools() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setMaxTotal(0);
  config.setMaxWaitMillis(2000);
  Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
  jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379));
  JedisCluster jc = new JedisCluster(jedisClusterNode, config);
  jc.set("52", "poolTestValue");
    }
View Full Code Here

  pool.destroy();
    }

    @Test
    public void checkCloseableConnections() throws Exception {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();

  JedisSentinelPool pool = new JedisSentinelPool(MASTER_NAME, sentinels,
    config, 1000, "foobared", 2);
  Jedis jedis = pool.getResource();
  jedis.auth("foobared");
View Full Code Here

    }

    @Test
    public void ensureSafeTwiceFailover() throws InterruptedException {
  JedisSentinelPool pool = new JedisSentinelPool(MASTER_NAME, sentinels,
    new GenericObjectPoolConfig(), 1000, "foobared", 2);

  forceFailover(pool);
  // after failover sentinel needs a bit of time to stabilize before a new
  // failover
  Thread.sleep(100);
View Full Code Here

TOP

Related Classes of org.apache.commons.pool2.impl.AbandonedConfig

Copyright © 2018 www.massapicom. 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.