proost commented on code in PR #19666:
URL: https://github.com/apache/druid/pull/19666#discussion_r3545498448
##########
extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheFactory.java:
##########
@@ -100,15 +90,25 @@ public static Cache create(final RedisCacheConfig config)
return new RedisStandaloneCache(
new JedisPool(
poolConfig,
- config.getHost(),
- config.getPort(),
- config.getTimeout().getMillisecondsAsInt(), //connection timeout
and read timeout
- config.getPassword() == null ? null :
config.getPassword().getPassword(),
- config.getDatabase(),
- null
+ new HostAndPort(config.getHost(), config.getPort()),
+ buildClientConfig(config)
),
config
);
}
}
+
+ private static JedisClientConfig buildClientConfig(RedisCacheConfig config)
+ {
+ return DefaultJedisClientConfig
+ .builder()
+ .connectionTimeoutMillis(config.getTimeout().getMillisecondsAsInt())
+ .socketTimeoutMillis(config.getTimeout().getMillisecondsAsInt())
+ .password(config.getPassword() == null ? null :
config.getPassword().getPassword())
+ // database applies to standalone only; Redis Cluster supports
database 0 only, so this
+ // is a no-op in cluster mode (the default is 0).
+ .database(config.getDatabase())
Review Comment:
Good point.
[603f1cd](https://github.com/apache/druid/pull/19666/commits/603f1cd4fd7843e2f7882bee3669f7b2758b2d77)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]