@Override public RedisClusterConnection getClusterConnection() { if (!isRedisClusterAware()) { throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); } return new JedisClusterConnection(cluster, clusterCommandExecutor); }
public void afterPropertiesSet() { if (shardInfo == null && clientConfiguration instanceof MutableJedisClientConfiguration) { providedShardInfo = false; shardInfo = new JedisShardInfo(getHostName(), getPort(), isUseSsl(), // clientConfiguration.getSslSocketFactory().orElse(null), // clientConfiguration.getSslParameters().orElse(null), // clientConfiguration.getHostnameVerifier().orElse(null)); getRedisPassword().map(String::new).ifPresent(shardInfo::setPassword); int readTimeout = getReadTimeout(); if (readTimeout > 0) { shardInfo.setSoTimeout(readTimeout); } getMutableConfiguration().setShardInfo(shardInfo); } if (getUsePool() && !isRedisClusterAware()) { this.pool = createPool(); } if (isRedisClusterAware()) { this.cluster = createCluster(); } }
public RedisConnection getConnection() { if (isRedisClusterAware()) { return getClusterConnection(); } Jedis jedis = fetchJedisConnector(); String clientName = clientConfiguration.getClientName().orElse(null); JedisConnection connection = (getUsePool() ? new JedisConnection(jedis, pool, getDatabase(), clientName) : new JedisConnection(jedis, null, getDatabase(), clientName)); connection.setConvertPipelineAndTxResults(convertPipelineAndTxResults); return postProcessConnection(connection); }
@Override public RedisClusterConnection getClusterConnection() { if (!isRedisClusterAware()) { throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); } return new JedisClusterConnection(cluster, clusterCommandExecutor); }
@Override public RedisClusterConnection getClusterConnection() { if (!isRedisClusterAware()) { throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); } return new JedisClusterConnection(cluster, clusterCommandExecutor); }
public void afterPropertiesSet() { if (shardInfo == null && clientConfiguration instanceof MutableJedisClientConfiguration) { providedShardInfo = false; shardInfo = new JedisShardInfo(getHostName(), getPort(), isUseSsl(), // clientConfiguration.getSslSocketFactory().orElse(null), // clientConfiguration.getSslParameters().orElse(null), // clientConfiguration.getHostnameVerifier().orElse(null)); getRedisPassword().map(String::new).ifPresent(shardInfo::setPassword); int readTimeout = getReadTimeout(); if (readTimeout > 0) { shardInfo.setSoTimeout(readTimeout); } getMutableConfiguration().setShardInfo(shardInfo); } if (getUsePool() && !isRedisClusterAware()) { this.pool = createPool(); } if (isRedisClusterAware()) { this.cluster = createCluster(); } }
public void afterPropertiesSet() { if (shardInfo == null && clientConfiguration instanceof MutableJedisClientConfiguration) { providedShardInfo = false; shardInfo = new JedisShardInfo(getHostName(), getPort(), isUseSsl(), // clientConfiguration.getSslSocketFactory().orElse(null), // clientConfiguration.getSslParameters().orElse(null), // clientConfiguration.getHostnameVerifier().orElse(null)); getRedisPassword().map(String::new).ifPresent(shardInfo::setPassword); int readTimeout = getReadTimeout(); if (readTimeout > 0) { shardInfo.setSoTimeout(readTimeout); } getMutableConfiguration().setShardInfo(shardInfo); } if (getUsePool() && !isRedisClusterAware()) { this.pool = createPool(); } if (isRedisClusterAware()) { this.cluster = createCluster(); } }
public RedisConnection getConnection() { if (isRedisClusterAware()) { return getClusterConnection(); } Jedis jedis = fetchJedisConnector(); String clientName = clientConfiguration.getClientName().orElse(null); JedisConnection connection = (getUsePool() ? new JedisConnection(jedis, pool, getDatabase(), clientName) : new JedisConnection(jedis, null, getDatabase(), clientName)); connection.setConvertPipelineAndTxResults(convertPipelineAndTxResults); return postProcessConnection(connection); }
public RedisConnection getConnection() { if (isRedisClusterAware()) { return getClusterConnection(); } Jedis jedis = fetchJedisConnector(); String clientName = clientConfiguration.getClientName().orElse(null); JedisConnection connection = (getUsePool() ? new JedisConnection(jedis, pool, getDatabase(), clientName) : new JedisConnection(jedis, null, getDatabase(), clientName)); connection.setConvertPipelineAndTxResults(convertPipelineAndTxResults); return postProcessConnection(connection); }
Config config = new Config(); RedisStandaloneConfiguration standaloneConfig = jedisConnectionFactory.getStandaloneConfiguration(); if (jedisConnectionFactory.isRedisClusterAware()) { logger.info("Cluster redis."); RedisClusterConfiguration clusterConfig = jedisConnectionFactory.getClusterConfiguration();