-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improve][Connector-v2] Redis support select db #5570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, overall LGTM, but you need offer e2e test cases for this change to verify it worked.
docs/en/connector-v2/sink/Redis.md
Outdated
@@ -20,6 +20,7 @@ Used to write data to Redis. | |||
| data_type | string | yes | - | | |||
| user | string | no | - | | |||
| auth | string | no | - | | |||
| db_num | int | no | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| db_num | int | no | - | | |
| db_num | int | no | 0 | |
@@ -40,6 +40,7 @@ public class RedisParameters implements Serializable { | |||
private String host; | |||
private int port; | |||
private String auth = ""; | |||
private Integer dbNum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private Integer dbNum; | |
private int dbNum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if (dbNum != null && dbNum > 0) { | ||
jedis.select(dbNum); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (dbNum != null && dbNum > 0) { | |
jedis.select(dbNum); | |
} | |
jedis.select(dbNum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return new JedisWrapper(jedisCluster); | ||
JedisWrapper jedisWrapper = new JedisWrapper(jedisCluster); | ||
if (dbNum != null && dbNum > 0) { | ||
jedisWrapper.select(dbNum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if (dbNum != null && dbNum > 0) { | ||
jedis.select(dbNum); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -40,6 +40,7 @@ public class RedisParameters implements Serializable { | |||
private String host; | |||
private int port; | |||
private String auth = ""; | |||
private Integer dbNum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
update PR title ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.intType() | ||
.defaultValue(0) | ||
.withDescription( | ||
"redis database index id, It is connected to db 0 by default"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"redis database index id, It is connected to db 0 by default"); | |
"Redis database index id, it is connected to db 0 by default"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I think @TyrantLucifer should take a look.
done |
Thanks @xiaofan2022 and @hailin0 @TyrantLucifer for review. |
Purpose of this pull request
redis select_db index #5415
Does this PR introduce any user-facing change?
no
How was this patch tested?
add new test
Check list
New License Guide
release-note
.