本文整理汇总了Java中redis.clients.jedis.tests.utils.ClientKillerUtil.tagClient方法的典型用法代码示例。如果您正苦于以下问题:Java ClientKillerUtil.tagClient方法的具体用法?Java ClientKillerUtil.tagClient怎么用?Java ClientKillerUtil.tagClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redis.clients.jedis.tests.utils.ClientKillerUtil
的用法示例。
在下文中一共展示了ClientKillerUtil.tagClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReturnConnectionOnJedisConnectionException
import redis.clients.jedis.tests.utils.ClientKillerUtil; //导入方法依赖的package包/类
@Test(timeout = DEFAULT_TIMEOUT)
public void testReturnConnectionOnJedisConnectionException() throws InterruptedException {
Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379));
JedisPoolConfig config = DEFAULT_CONFIG;
config.setMaxTotal(1);
JedisCluster jc = new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS, "cluster", config);
Jedis j = jc.getClusterNodes().get("127.0.0.1:7380").getResource();
ClientKillerUtil.tagClient(j, "DEAD");
ClientKillerUtil.killClient(j, "DEAD");
j.close();
jc.get("test");
}
示例2: testReturnConnectionOnJedisConnectionException
import redis.clients.jedis.tests.utils.ClientKillerUtil; //导入方法依赖的package包/类
@Test(timeout = 2000)
public void testReturnConnectionOnJedisConnectionException() throws InterruptedException {
Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379));
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxTotal(1);
JedisCluster jc = new JedisCluster(jedisClusterNode, config);
Jedis j = jc.getClusterNodes().get("127.0.0.1:7380").getResource();
ClientKillerUtil.tagClient(j, "DEAD");
ClientKillerUtil.killClient(j, "DEAD");
j.close();
jc.get("test");
}