K
- Key type.V
- Value type.public interface RedisClusterConnection<K,V> extends RedisHashesConnection<K,V>, RedisKeysConnection<K,V>, RedisStringsConnection<K,V>, RedisListsConnection<K,V>, RedisSetsConnection<K,V>, RedisSortedSetsConnection<K,V>, RedisScriptingConnection<K,V>, RedisServerConnection<K,V>, RedisHLLConnection<K,V>, RedisGeoConnection<K,V>
Modifier and Type | Method and Description |
---|---|
String |
asking()
The asking command is required after a
-ASK redirection. |
void |
close()
Close the connection.
|
String |
clusterAddSlots(int... slots)
Adds slots to the cluster node.
|
Long |
clusterCountKeysInSlot(int slot)
Returns the number of keys in the specified Redis Cluster hash
slot . |
String |
clusterDelSlots(int... slots)
Removes slots from the cluster node.
|
String |
clusterFailover(boolean force)
Failover a cluster node.
|
String |
clusterFlushslots()
Delete all the slots associated with the specified node.
|
String |
clusterForget(String nodeId)
Blacklist and remove the cluster node from the cluster.
|
List<K> |
clusterGetKeysInSlot(int slot,
int count)
Retrieve the list of keys within the
slot . |
String |
clusterInfo()
Get information and statistics about the cluster viewed by the current node.
|
String |
clusterMeet(String ip,
int port)
Meet another cluster node to include the node into the cluster.
|
String |
clusterMyId()
Obtain the nodeId for the currently connected node.
|
String |
clusterNodes()
Obtain details about all cluster nodes.
|
String |
clusterReplicate(String nodeId)
Turn this node into a slave of the node with the id
nodeId . |
String |
clusterReset(boolean hard)
Reset a node performing a soft or hard reset:
All other nodes are forgotten
All the assigned / open slots are released
If the node is a slave, it turns into a master
Only for hard reset: a new Node ID is generated
Only for hard reset: currentEpoch and configEpoch are set to 0
The new configuration is saved and the cluster state updated
If the node was a slave, the whole data set is flushed away
|
String |
clusterSetSlotImporting(int slot,
String nodeId)
Flag a slot as IMPORTING (incoming) from the node specified in
nodeId . |
String |
clusterSetSlotMigrating(int slot,
String nodeId)
Flag a slot as MIGRATING (outgoing) towards the node specified in
nodeId . |
String |
clusterSetSlotNode(int slot,
String nodeId)
Assign a slot to a node.
|
List<String> |
clusterSlaves(String nodeId)
List slaves for a certain node identified by its
nodeId . |
List<Object> |
clusterSlots()
Get array of cluster slots to node mappings.
|
String |
readOnly()
Tells a Redis cluster slave node that the client is ok reading possibly stale data and is not interested in running write
queries.
|
String |
readWrite()
Resets readOnly flag.
|
hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hsetnx, hstrlen, hvals, hvals
del, dump, exists, exists, expire, expireat, expireat, keys, keys, migrate, move, objectEncoding, objectIdletime, objectRefcount, persist, pexpire, pexpireat, pexpireat, pttl, randomkey, rename, renamenx, restore, scan, scan, scan, scan, scan, scan, scan, scan, sort, sort, sort, sort, sortStore, ttl, type
append, bitcount, bitcount, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, decr, decrby, get, getbit, getrange, getset, incr, incrby, incrbyfloat, mget, mget, mset, msetnx, psetex, set, set, setbit, setex, setnx, setrange, strlen
blpop, brpop, brpoplpush, lindex, linsert, llen, lpop, lpush, lpushx, lrange, lrange, lrem, lset, ltrim, rpop, rpoplpush, rpush, rpushx
sadd, scard, sdiff, sdiff, sdiffstore, sinter, sinter, sinterstore, sismember, smembers, smembers, smove, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sunion, sunion, sunionstore
zadd, zadd, zadd, zadd, zaddincr, zcard, zcount, zcount, zincrby, zinterstore, zinterstore, zlexcount, zrange, zrange, zrangebylex, zrangebylex, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangeWithScores, zrangeWithScores, zrank, zrem, zremrangebylex, zremrangebyrank, zremrangebyscore, zremrangebyscore, zrevrange, zrevrange, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunionstore, zunionstore
eval, eval, evalsha, evalsha, scriptExists, scriptFlush, scriptKill, scriptLoad
bgrewriteaof, bgsave, clientGetname, clientKill, clientKill, clientList, clientPause, clientSetname, command, commandCount, commandInfo, commandInfo, configGet, configResetstat, configRewrite, configSet, dbsize, debugHtstats, debugObject, debugOom, debugSegfault, flushall, flushdb, info, info, lastsave, save, shutdown, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, sync, time
pfadd, pfcount, pfmerge
geoadd, geoadd, geodist, geopos, georadius, georadius, georadiusbymember, georadiusbymember
void close()
String clusterMeet(String ip, int port)
ip
- IP address of the hostport
- port number.String clusterForget(String nodeId)
nodeId
- the node IdString clusterAddSlots(int... slots)
slots
- one or more slots from 0 to 16384String clusterDelSlots(int... slots)
slots
- one or more slots from 0 to 16384String clusterSetSlotNode(int slot, String nodeId)
nodeId
slot
- the slotnodeId
- the id of the node that will become the master for the slotString clusterSetSlotMigrating(int slot, String nodeId)
nodeId
. The slot must be handled by
the current node in order to be migrated.slot
- the slotnodeId
- the id of the node is targeted to become the master for the slotString clusterSetSlotImporting(int slot, String nodeId)
nodeId
.slot
- the slotnodeId
- the id of the node is the master of the slotString clusterInfo()
String clusterMyId()
String clusterNodes()
ClusterPartitionParser.parse(java.lang.String)
List<String> clusterSlaves(String nodeId)
nodeId
. Can be parsed using
ClusterPartitionParser.parse(java.lang.String)
nodeId
- node id of the master nodeclusterNodes()
but one line per slave.List<K> clusterGetKeysInSlot(int slot, int count)
slot
.slot
- the slotcount
- maximal number of keysLong clusterCountKeysInSlot(int slot)
slot
.slot
- the slotList<Object> clusterSlots()
String asking()
-ASK
redirection. The client should issue ASKING
before to actually send the
command to the target instance. See the Redis Cluster specification for more information.String clusterReplicate(String nodeId)
nodeId
.nodeId
- master node idString clusterFailover(boolean force)
force
- do not coordinate with master if trueString clusterReset(boolean hard)
hard
- true for hard reset. Generates a new nodeId and currentEpoch/configEpoch are set to 0String clusterFlushslots()
String readOnly()
String readWrite()
Copyright © 2015. All rights reserved.