Skip to content

Conversation

@HeartSaVioR
Copy link
Contributor

Hello.

As supporting Redis Cluster work, I implemented Cluster multi key commands based on previous interfaces.

During implementing, I found that some commands are fine with Redis, but maybe some commands are not fine with Redis Cluster.
(Actually there're no documentation from Redis describing cluster-able commands.)

So I removed some suspicious commands from interface, and introduced new interfaces for Jedis Cluster.
(Please let me know when you think something is wrong.)

Below is the commands I removed from previous interfaces.

BinaryJedisClusterCommands (copied from BinaryCommands)

  • List<byte[]> blpop(byte[] arg);
  • List<byte[]> brpop(byte[] arg);
  • Long move(byte[] key, int dbIndex);

MultiKeyBinaryJedisClusterCommands (copied from MultiKeyBinaryCommands)

  • List<byte[]> blpop(byte[]... args);
  • List<byte[]> brpop(byte[]... args);
  • Set<byte[]> keys(byte[] pattern);
  • String watch(byte[]... keys);
  • String unwatch();
  • byte[] randomBinaryKey();

JedisClusterCommands (copied from JedisCommands)

  • List blpop(String arg);
  • List brpop(String arg);
  • Long move(String key, int dbIndex);
  • ScanResult<Map.Entry<String, String>> hscan(final String key, int cursor);
  • ScanResult sscan(final String key, int cursor);
  • ScanResult zscan(final String key, int cursor);

MultiKeyJedisClusterCommands (copied from MultiKeyCommands)

  • String watch(String... keys);
  • String unwatch();
  • String randomKey();
  • ScanResult scan(int cursor);
  • ScanResult scan(final String cursor);
  • Set keys(String pattern);
  • List blpop(String... args);
  • List brpop(String... args);

And I introduce some utils and exception, you can find it from commit log.

Please review and comment so that this PR goes to cluster-revised.
Thanks!

* 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
@vishnusaran
Copy link

I would really appreciate if the authors could merge this pull request. I am very dependent on this feature. Thanks!!

@HeartSaVioR
Copy link
Contributor Author

@xetorthio @marcosnils
Early adopters need this functionalities, so we would review this and merge to cluster-revised branch.
Please review when you have some leisure time. Thanks in advance!

@xetorthio
Copy link
Contributor

There are lots of spaces and tab changes which makes it extremely hard to read the code and see the actual changes.
Would you mind re-sending the PR without those extra spaces and tabs?

@HeartSaVioR
Copy link
Contributor Author

@xetorthio Oh, I'm sorry.
I'm using IntelliJ (as you know), and I was applying "format" from STS.
In the result unintention things are also formatted.
Let me check it again. Thanks!

@HeartSaVioR
Copy link
Contributor Author

Let's move on #687! Closing.

@HeartSaVioR HeartSaVioR closed this Aug 5, 2014
HeartSaVioR added a commit that referenced this pull request Apr 20, 2015
Supports Multi Key commands to JedisCluster (revised of #673)
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.

3 participants