use of com.ctrip.xpipe.redis.core.protocal.cmd.ConfigSetCommand.ConfigSetMinSlavesToWrite in project x-pipe by ctripcorp.
the class MinSlavesRedisReadOnly method createTransactionalCommand.
private Command<?> createTransactionalCommand(int number) {
SimpleObjectPool<NettyClient> clientPool = keyedObjectPool.getKeyPool(new InetSocketAddress(ip, port));
ConfigSetMinSlavesToWrite configSetMinSlavesToWrite = new ConfigSetMinSlavesToWrite(null, number, scheduled);
return new TransactionalCommand(clientPool, scheduled, configSetMinSlavesToWrite, new ConfigRewrite(null, scheduled));
}
use of com.ctrip.xpipe.redis.core.protocal.cmd.ConfigSetCommand.ConfigSetMinSlavesToWrite 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);
}
Aggregations