Search in sources :

Example 51 with HostAndPort

use of redis.clients.jedis.HostAndPort in project oxCore by GluuFederation.

the class RedisStandaloneProvider method create.

public void create() {
    LOG.debug("Starting RedisStandaloneProvider ...");
    try {
        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxTotal(1000);
        poolConfig.setMinIdle(2);
        HostAndPort hostAndPort = RedisClusterProvider.hosts(redisConfiguration.getServers()).iterator().next();
        pool = new JedisPool(poolConfig, hostAndPort.getHost(), hostAndPort.getPort());
        testConnection();
        LOG.debug("RedisStandaloneProvider started.");
    } catch (Exception e) {
        throw new IllegalStateException("Error starting RedisStandaloneProvider", e);
    }
}
Also used : HostAndPort(redis.clients.jedis.HostAndPort) JedisPool(redis.clients.jedis.JedisPool) JedisPoolConfig(redis.clients.jedis.JedisPoolConfig)

Aggregations

HostAndPort (redis.clients.jedis.HostAndPort)51 Test (org.junit.Test)28 HashSet (java.util.HashSet)23 JedisCluster (redis.clients.jedis.JedisCluster)23 LinkedHashSet (java.util.LinkedHashSet)18 Jedis (redis.clients.jedis.Jedis)14 JedisPoolConfig (redis.clients.jedis.JedisPoolConfig)7 JedisPool (redis.clients.jedis.JedisPool)6 ArrayList (java.util.ArrayList)4 Before (org.junit.Before)4 JedisSentinelPool (redis.clients.jedis.JedisSentinelPool)3 ClusterNodeInformation (redis.clients.util.ClusterNodeInformation)3 InstanceInfo (com.sohu.cache.entity.InstanceInfo)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 JedisPubSub (redis.clients.jedis.JedisPubSub)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 RedisClusterReshard (com.sohu.cache.redis.RedisClusterReshard)1