You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@bahir.apache.org by GitBox <gi...@apache.org> on 2021/01/10 12:38:17 UTC

[GitHub] [bahir-flink] miraisenshi opened a new pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

miraisenshi opened a new pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104


   Added `testOnBorrow`, `testOnReturn` and `testWhileIdle` options for Flink-Redis Connector. Details can be found at https://issues.apache.org/jira/browse/BAHIR-247


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] eskabetxe commented on pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
eskabetxe commented on pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#issuecomment-799266419


   closing this as we are addressing the last changes on https://github.com/apache/bahir-flink/pull/121


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] miraisenshi commented on pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
miraisenshi commented on pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#issuecomment-757481679


   @gyfora @mbalassi @lresende Please help review this PR, many thanks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] eskabetxe commented on a change in pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
eskabetxe commented on a change in pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#discussion_r554891072



##########
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:
       if this are the default params, why we have to set them?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] lmagic233 commented on a change in pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [bahir-flink] YikSanChan commented on pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
YikSanChan commented on pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#issuecomment-799260477


   Hi @eskabetxe, if you look up "<<<<<<<" in the code, there are a few conflicts to be resolved.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] eskabetxe commented on a change in pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
eskabetxe commented on a change in pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#discussion_r556403547



##########
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:
       it is better to create a variable in the class and have the value defined in only 1 place...
   if this value can be obtained in some way from the default values of the library, it is better (always with the constant in the class)




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] YikSanChan commented on pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
YikSanChan commented on pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#issuecomment-796936066


   @lmagic233 I read your blog post https://www.jianshu.com/p/8df8b95b06d2 and I need this feature too - do you want to address Joao's comments? Thanks. If you're too busy to work on this again, I can pick up where you left


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] eskabetxe commented on pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
eskabetxe commented on pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104#issuecomment-799266025


   shit I will close this PR, @YikSanChan I fix your branch


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [bahir-flink] eskabetxe closed pull request #104: [BAHIR-247] Provide connection validation/idle testing for Flink-Redis Connector

Posted by GitBox <gi...@apache.org>.
eskabetxe closed pull request #104:
URL: https://github.com/apache/bahir-flink/pull/104


   


----------------------------------------------------------------
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:
users@infra.apache.org