-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3547
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2c247d5
Add active detection in sentinel mode,Reconstruct sentinel mode Liste…
032d017
Merge branch 'master' into master
chenshi5012 6e06c03
to ensure ZSentinelMasterListenerTest run as the last one
912eb75
Merge branch 'master' of https://github.com/chenshi5012/jedis
3ca30da
test case for SentinelMasterListener
9094868
test case for SentinelMasterListener
dc6ece2
remove test order
f19c663
test case for sentinel master listener
23813a2
test case for testSentinelMasterListener
32f0fbd
build sentinel for master listeners
773b98b
test case for sentinel master listener
6314ea4
fix failover timeout time
d7cfc28
add more sleep time to make sure failove be detect
c40bfa0
modify localhost to 127
4f93eae
test case add master listener to sentinel
3611c0f
1
5e4fd16
Revert "Support GEOSHAPE field type in RediSearch (#3561)"
7e241e8
test case for testSentinelMasterListener
b9f9aa8
modify the code structure
d7e9dd2
modify comment
465e5ba
move to new package
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package redis.clients.jedis; | ||
|
||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | ||
|
||
public class SentinelPoolConfig extends GenericObjectPoolConfig { | ||
|
||
private boolean enableActiveDetectListener = false; | ||
private long activeDetectIntervalTimeMillis = 5 * 1000; | ||
|
||
private boolean enableDefaultSubscribeListener = true; | ||
private long subscribeRetryWaitTimeMillis = 5 * 1000; | ||
|
||
public boolean isEnableActiveDetectListener() { | ||
return enableActiveDetectListener; | ||
} | ||
|
||
public void setEnableActiveDetectListener(boolean enableActiveDetectListener) { | ||
this.enableActiveDetectListener = enableActiveDetectListener; | ||
} | ||
|
||
public long getActiveDetectIntervalTimeMillis() { | ||
return activeDetectIntervalTimeMillis; | ||
} | ||
|
||
public void setActiveDetectIntervalTimeMillis(long activeDetectIntervalTimeMillis) { | ||
this.activeDetectIntervalTimeMillis = activeDetectIntervalTimeMillis; | ||
} | ||
|
||
public boolean isEnableDefaultSubscribeListener() { | ||
return enableDefaultSubscribeListener; | ||
} | ||
|
||
public void setEnableDefaultSubscribeListener(boolean enableDefaultSubscribeListener) { | ||
this.enableDefaultSubscribeListener = enableDefaultSubscribeListener; | ||
} | ||
|
||
public long getSubscribeRetryWaitTimeMillis() { | ||
return subscribeRetryWaitTimeMillis; | ||
} | ||
|
||
public void setSubscribeRetryWaitTimeMillis(long subscribeRetryWaitTimeMillis) { | ||
this.subscribeRetryWaitTimeMillis = subscribeRetryWaitTimeMillis; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
GenericObjectPoolConfig takes a type argument. Declaring a sub-class without the type argument is anti-pattern.
Idea: Just declare this interface separately without sub-classing it; with a more appropriate name.
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.
may be sub-class is the best way to avoid add more Constructor method . currently threse are 24 Constructor method for JedisSentinelPool.
use sub-class will not break the Constructor parameter type GenericObjectPoolConfig.
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 that's your concern, you can introduce a Builder.