lmagic233 commented on a change in pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#discussion_r555475439



##########
File path: 
flink-connector-redis/src/main/java/org/apache/flink/streaming/connectors/redis/common/container/RedisCommandsContainerBuilder.java
##########
@@ -66,10 +66,20 @@ public static RedisCommandsContainer 
build(FlinkJedisPoolConfig jedisPoolConfig)
         genericObjectPoolConfig.setMaxIdle(jedisPoolConfig.getMaxIdle());
         genericObjectPoolConfig.setMaxTotal(jedisPoolConfig.getMaxTotal());
         genericObjectPoolConfig.setMinIdle(jedisPoolConfig.getMinIdle());
+        
genericObjectPoolConfig.setTestOnBorrow(jedisPoolConfig.getTestOnBorrow());
+        
genericObjectPoolConfig.setTestOnReturn(jedisPoolConfig.getTestOnReturn());
+
+        if (jedisPoolConfig.getTestWhileIdle()) {
+            // default parameters from redis.clients.jedis.JedisPoolConfig
+            genericObjectPoolConfig.setTestWhileIdle(true);

Review comment:
       OK, I will write a test to check this. 
   
   As for the default params, it is provided by JedisPoolConfig (a subclass of 
GenericObjectPoolConfig in Jedis), but not GenericObjectPoolConfig itself, so I 
chose to set them explicitly. Do you think we should just replace it with 
JedisPoolConfig when `testWhileIdle` is set to true?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to