Package redis.clients.jedis

Examples of redis.clients.jedis.JedisPool


    }

    public void init() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        // TODO optional parameterization
        jedisPool = new JedisPool(jedisPoolConfig, redisHost, redisPort);
    }
View Full Code Here


public class RedisBasedCache implements Cache {

    private JedisPool jedisPool = null;

    public RedisBasedCache(String host, int port) {
        jedisPool = new JedisPool(JedisPoolUtil.createJedisPoolConfig(),host,port);
    }
View Full Code Here

    public RedisBasedCache(String host, int port) {
        jedisPool = new JedisPool(JedisPoolUtil.createJedisPoolConfig(),host,port);
    }

    public RedisBasedCache(String host, int port, String password) {
        jedisPool = new JedisPool(JedisPoolUtil.createJedisPoolConfig(),host,port, 10000,password);
    }
View Full Code Here

    poolConfig.setNumTestsPerEvictionRun(10);
    // Idle connection checking period
    poolConfig.setTimeBetweenEvictionRunsMillis(60000);

    // Create the jedisPool
    this.pools.put(host, new JedisPool(poolConfig, server, port));
  }
View Full Code Here

   *
   * @param host
   *            Redis host description
   */
  public synchronized void release(String host) {
    JedisPool pool = this.pools.get(host);
    if (pool != null) {
      pool.destroy();
    }
  }
View Full Code Here

   *            Redis host description
   * @param jedis
   *            connection to be returned
   */
  public void returnJedis(String host, Jedis jedis) {
    JedisPool pool = this.pools.get(host);
    if (pool != null) {
      pool.returnResource(jedis);
    }
  }
View Full Code Here

  public JedisPool build() {
    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(maxTotal);

    return new JedisPool(config, host, port, timeout, StringUtils.trimToNull(password), database);
  }
View Full Code Here

    private final StringRedisSerializer regionSerializer = new StringRedisSerializer();
    private final StringRedisSerializer keySerializer = new StringRedisSerializer();
    private final RedisSerializer<Object> valueSerializer = new SnappyRedisSerializer<Object>();

    public JedisClient() {
        this(new JedisPool("localhost"), DEFAULT_EXPIRY_IN_SECONDS);
    }
View Full Code Here

        Integer database = Integer.decode(props.getProperty("redis.database", String.valueOf(Protocol.DEFAULT_DATABASE)));

        log.info("create JedisPool. host=[{}], port=[{}], timeout=[{}], password=[{}], database=[{}]",
                 host, port, timeout, password, database);

        return new JedisPool(createJedisPoolConfig(), host, port, timeout, password, database);
    }
View Full Code Here

    @Override
    public GelfSender create(GelfSenderConfiguration configuration) throws IOException {
        String graylogHost = configuration.getHost();

        URI hostUri = URI.create(graylogHost);
        JedisPool pool = RedisSenderPoolProvider.INSTANCE.getJedisPool(hostUri, configuration.getPort());
        return new GelfREDISSender(pool, hostUri.getFragment(), configuration.getErrorReport());
       
    }
View Full Code Here

TOP

Related Classes of redis.clients.jedis.JedisPool

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.