use of com.ctrip.xpipe.redis.core.protocal.cmd.XSlaveofCommand in project x-pipe by ctripcorp.
the class TransactionalSlaveOfCommand method doExecute.
@Override
protected void doExecute() throws CommandExecutionException {
logger.info("[doExecute][try xslaveof]{}", this);
TransactionalCommand slaveofTransaction = new TransactionalCommand(getClientPool(), scheduled, new XSlaveofCommand(null, ip, port, scheduled), new ConfigRewrite(null, scheduled));
try {
slaveofTransaction.execute().addListener(new CommandFutureListener<Object[]>() {
@Override
public void operationComplete(CommandFuture<Object[]> commandFuture) throws Exception {
if (!commandFuture.isSuccess()) {
failXslaveof(commandFuture.cause());
} else {
logger.info("[doExecute][xslaveof success]{}", this);
future().setSuccess(commandFuture.get());
}
}
});
} catch (Exception e) {
failXslaveof(e);
}
}
use of com.ctrip.xpipe.redis.core.protocal.cmd.XSlaveofCommand in project x-pipe by ctripcorp.
the class XSlaveofTest method test.
@Test
public void test() throws Exception {
XSlaveofCommand command = new XSlaveofCommand(clientPool, "10.2.58.242", 6479, scheduled);
command.execute().get();
}
Aggregations