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

Configure a Sentinel Connection when initialising the Sentinel pool #1943

Merged
merged 5 commits into from Nov 26, 2019
Merged

Configure a Sentinel Connection when initialising the Sentinel pool #1943

merged 5 commits into from Nov 26, 2019

Conversation

karltinawi
Copy link
Contributor

@karltinawi karltinawi commented Jan 28, 2019

This commit attempts to solve #1487 and #1636.

This PR adds a constructor to JedisSentinelPool to configure a Sentinel connection with respective timeout settings and a password. Supporting constructors have also been added to BinaryJedis and Jedis classes.

Thanks in advance for your review.

Added a constructor to JedisSentinelPool to configure a Sentinel
connection with respective timeout settings and a password.
@karltinawi karltinawi changed the title Configure a Sentinel Connection when initialising the pool (#1487 and #1636) Configure a Sentinel Connection when initialising the Sentinel pool Jan 28, 2019
- Removed the default password variable
- Always initialise Jedis with password (null password is ignored)
- Move sentinal parameters after client parameters
src/main/java/redis/clients/jedis/JedisSentinelPool.java Outdated Show resolved Hide resolved
src/main/java/redis/clients/jedis/JedisSentinelPool.java Outdated Show resolved Hide resolved
src/main/java/redis/clients/jedis/BinaryJedis.java Outdated Show resolved Hide resolved
src/main/java/redis/clients/jedis/Jedis.java Outdated Show resolved Hide resolved
- Added constructor to allow 'sentinelClientName'.
- Use auth() and clientSetName() when creating Jedis to connect to sentinel
- Removed newly added constructors from Jedis and BinaryJedis
- Removed constructor the defaults sentinelClientName to 'null'.
- Resolved 'tab' indentation
- Moved all sentinel instance variables after 'master' variables.
@sazzad16 sazzad16 added this to the 3.1.0 milestone Jan 30, 2019
@karltinawi
Copy link
Contributor Author

Thanks @sazzad16.

protected String password;

protected int database = Protocol.DEFAULT_DATABASE;
protected int database;
Copy link
Contributor

Choose a reason for hiding this comment

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

final?


protected String clientName;

protected int sentinelConnectionTimeout;
protected int sentinelSoTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

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

should all these fields be final?

@sazzad16 sazzad16 modified the milestones: 3.1.0, 3.2.0 Jul 17, 2019
@silentFred
Copy link

What is the holdup on this PR? Would be great to have this sometime

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.

None yet

4 participants