Skip to content

Commit 3d1f43d

Browse files
DATAREDIS-315 - Add Support for redis cluster.
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….
1 parent 1d4fe01 commit 3d1f43d

File tree

4 files changed

+1986
-0
lines changed

4 files changed

+1986
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2015 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.data.redis.connection;
17+
18+
/**
19+
* @author Christoph Strobl
20+
*/
21+
public interface RedisClusterCommands {
22+
23+
Iterable<RedisNode> getClusterNodes();
24+
25+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2015 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.data.redis.connection;
17+
18+
import java.util.Properties;
19+
import java.util.Set;
20+
21+
/**
22+
* @author Christoph Strobl
23+
* @since 1.5
24+
*/
25+
public interface RedisClusterConnection extends RedisConnection, RedisClusterCommands {
26+
27+
String ping(RedisNode node);
28+
29+
void bgRewriteAof(RedisNode node);
30+
31+
void bgSave(RedisNode node);
32+
33+
Long lastSave(RedisNode node);
34+
35+
void save(RedisNode node);
36+
37+
Long dbSize(RedisNode node);
38+
39+
void flushDb(RedisNode node);
40+
41+
void flushAll(RedisNode node);
42+
43+
Properties info(RedisNode node);
44+
45+
Set<byte[]> keys(byte[] pattern, RedisNode node);
46+
47+
byte[] randomKey(RedisNode node);
48+
49+
void shutdown(RedisNode node);
50+
51+
}

0 commit comments

Comments
 (0)