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
Jedis Cluster functionalities improved (cluster-revised branch) #671
Conversation
Cluster scripting commands
Fixed cluster scripting commands build test
-Add missing scripting methods with key -Separate ScriptingCommands from JedisClusterScriptingCommands
-Pass keyCount to runScript method
- Changed runScript() to run()
- Add missing methods with key parameter - Separate BinaryScriptingCommands from JedisClusterBinaryScriptingCommands
Binary jedis commands for cluster
- Add missing methods with key parameter - Separate BinaryScriptingCommands from JedisClusterBinaryScriptingCommands
- Removed runBinaryScript
- fixed getSlot bug - fixed eval method that uses bytearray keyCount - changed methods that pass 1 for keyCount - pass arg to runBinary
- removed BasicCommands
- Added getClusterNodes method back from accidentally removing it
- Removed test case using deprecated ping method
…is-cluster Remove BasicCommand implementation from JedisCluster
…-revised Conflicts: src/main/java/redis/clients/jedis/JedisCluster.java
* add missing methods from BinaryJedisCluster Conflicts: src/main/java/redis/clients/jedis/JedisCluster.java
* New interfaces introduced (copy existing interfaces and remove some commands) * there're some commands that doesn't seems to compatible with Redis Cluster * remove commands from BinaryJedisCluster & JedisCluster * Add some util (KeyMergeUtil), exception (related CROSSSLOT) classes * Add runWithAnyNode() to JedisClusterCommand * some of commands (ex. publish/subscribe) doesn't need to run into specific node
Conflicts: src/main/java/redis/clients/jedis/BinaryJedisCluster.java src/main/java/redis/clients/jedis/JedisCluster.java
Supports Multi Key commands to JedisCluster (revised of #673)
So many random tests failure occurred... We should have an issue tracing these and try to fix / discard tests. |
@marcosnils |
Please note that I spent another over 1 hours to upmerge #687 and this. |
* remove some of methods from common interface which doesn't fit RedisCluster ** move
@christophstrobl |
thanks @HeartSaVioR! |
Jedis Cluster functionalities improved (cluster-revised branch)
@HeartSaVioR exceptional work, I don't have preliminary observations. This PR really takes us really close to have a 3.0 version!. |
@marcosnils Thanks for reviewing huge PR! Great work! |
@marcosnils @HeartSaVioR @christophstrobl you guys do a great job. great programer! Thank all of you! |
Added ClusterConnection and started implementing required stuff for jedis as a start. Since there’s an open PR for jedis (redis/jedis#671) we should wait for that one to be fixed since it includes major stuff that’s currently missing to it still allowes to issue invalid commands like move that cannot be run in cluster mode….
Is the intent to remove any common protocol between Jedis/JedisCluster for the 3.0 version? |
@bpoweski what do you mean exactly by "removing common protocols"? |
Apologies, I meant interfaces! In the 2.7.3 branch public class JedisCluster implements JedisCommands, BasicCommands, Closeable
public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands,
AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands, SentinelCommands In master they now have: public class JedisCluster extends BinaryJedisCluster implements JedisClusterCommands,
MultiKeyJedisClusterCommands, JedisClusterScriptingCommands
public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands,
AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands, SentinelCommands While there are various caveats for using Redis cluster, the underlying API is mostly the same. Having a common interface between the two clients is useful. For example, we run our application using both a Redis Cluster and a non clustered Redis configuration. We currently use |
@bpoweski tl;dr. There's pros and cons about each approach, and I just pick first one. It could be changed anytime when there's elegant way to resolve. Also please note that Jedis 3.0 should be breaking changes, so we're free to REWRITE whole codes though I think it's hard to be occured for now. |
Have you considered rolling up shared signatures into a common interface and then using public interface JedisCommands {
String set(String key, String value);
..
}
public interface JedisClusterCommands {
String set(String key, String value);
..
} to: public interface SingleKeyCommands {
String set(String key, String value);
}
public interface JedisCommands extends SingleKeyCommands {
..
}
public interface JedisClusterCommands extends SingleKeyCommands, OtherSpecificNonClusterAllowedCommands {
..
} An added benefit is that it would facilitate decomposing the larger |
@bpoweski Maintaining OtherSpecificNonClusterAllowedCommands should be annoying. |
@bpoweski Forgot to say "Thanks for giving your opinion!" :) |
@HeartSaVioR, thank you for your work on this project. |
Added ClusterConnection and started implementing required stuff for jedis as a start. Since there’s an open PR for jedis (redis/jedis#671) we should wait for that one to be fixed since it includes major stuff that’s currently missing to it still allowes to issue invalid commands like move that cannot be run in cluster mode….
when will 3.0.0 release? |
Since there're some PRs on JedisCluster and it will be merged on 3.0.0, we can incubate cluster-revised branch for improving JedisCluster.
Currently these PRs are merged to cluster-revised branch (updated continuously)