Skip to content
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

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

xiaofan2022
Copy link
Contributor

@xiaofan2022 xiaofan2022 commented Sep 27, 2023

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

Copy link
Member

@TyrantLucifer TyrantLucifer left a 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.

@@ -20,6 +20,7 @@ Used to write data to Redis.
| data_type | string | yes | - |
| user | string | no | - |
| auth | string | no | - |
| db_num | int | no | - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private Integer dbNum;
private int dbNum;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 123 to 125
if (dbNum != null && dbNum > 0) {
jedis.select(dbNum);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (dbNum != null && dbNum > 0) {
jedis.select(dbNum);
}
jedis.select(dbNum);

Copy link
Contributor Author

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as above.

Copy link
Contributor Author

@xiaofan2022 xiaofan2022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 123 to 125
if (dbNum != null && dbNum > 0) {
jedis.select(dbNum);
}
Copy link
Contributor Author

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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@hailin0
Copy link
Member

hailin0 commented Oct 7, 2023

update PR title ?

@xiaofan2022 xiaofan2022 changed the title Redis select db [Improve][Connector-v2] Redis select db Oct 7, 2023
Copy link
Contributor Author

@xiaofan2022 xiaofan2022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

@xiaofan2022 xiaofan2022 left a 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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"redis database index id, It is connected to db 0 by default");
"Redis database index id, it is connected to db 0 by default");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Hisoka-X Hisoka-X changed the title [Improve][Connector-v2] Redis select db [Improve][Connector-v2] Redis support select db Oct 11, 2023
Copy link
Member

@Hisoka-X Hisoka-X left a 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.

@xiaofan2022
Copy link
Contributor Author

Thank you for your contribution, overall LGTM, but you need offer e2e test cases for this change to verify it worked.

done

@TyrantLucifer TyrantLucifer merged commit 77fbbbd into apache:dev Oct 17, 2023
@Hisoka-X
Copy link
Member

Thanks @xiaofan2022 and @hailin0 @TyrantLucifer for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants