jedis cluster test

This commit is contained in:
LingZhaoHui 2022-01-08 21:02:01 +08:00
parent 6931717475
commit 8f1f3d8e8d
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package com.zeekling.redis;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
public class JedisClusterTest {
private JedisCluster cluster;
private Jedis jedis;
public JedisClusterTest(){
cluster = new JedisCluster(new HostAndPort("127.0.0.1", 30001));
jedis = new Jedis("127.0.0.1", 30001);
}
public void countKeyInSlot(int slot){
jedis.clusterCountKeysInSlot(slot);
}
public static void main(String[] args) {
JedisClusterTest test = new JedisClusterTest();
test.countKeyInSlot(4);
test.countKeyInSlot(16384);
}
}