use of com.ctrip.xpipe.redis.core.protocal.cmd.ConfigGetCommand.ConfigGetMinSlavesToWrite in project x-pipe by ctripcorp.
the class ConfigCommandTest method testConfigMinSlaves.
@Test
public void testConfigMinSlaves() throws InterruptedException, ExecutionException, Exception {
InetSocketAddress address = new InetSocketAddress(ip, port);
Integer min = new ConfigGetMinSlavesToWrite(getXpipeNettyClientKeyedObjectPool().getKeyPool(address), scheduled).execute().get();
logger.info("{}", min);
Boolean result = new ConfigSetMinSlavesToWrite(getXpipeNettyClientKeyedObjectPool().getKeyPool(address), 100, scheduled).execute().get();
logger.info("{}", result);
min = new ConfigGetMinSlavesToWrite(getXpipeNettyClientKeyedObjectPool().getKeyPool(address), scheduled).execute().get();
logger.info("{}", min);
}
use of com.ctrip.xpipe.redis.core.protocal.cmd.ConfigGetCommand.ConfigGetMinSlavesToWrite in project x-pipe by ctripcorp.
the class MinSlavesRedisReadOnlyTest method testMark.
// manual start redis at host:port
@Test
public void testMark() throws Exception {
minSlavesRedisReadOnly.makeReadOnly();
int number = new ConfigGetMinSlavesToWrite(getXpipeNettyClientKeyedObjectPool().getKeyPool(new InetSocketAddress(host, port)), scheduled).execute().get();
Assert.assertEquals(MinSlavesRedisReadOnly.READ_ONLY_NUMBER, number);
minSlavesRedisReadOnly.makeWritable();
number = new ConfigGetMinSlavesToWrite(getXpipeNettyClientKeyedObjectPool().getKeyPool(new InetSocketAddress(host, port)), scheduled).execute().get();
Assert.assertEquals(MinSlavesRedisReadOnly.WRITABLE_NUMBER, number);
}
Aggregations