use of com.ctrip.xpipe.redis.core.protocal.cmd.DefaultPsync in project x-pipe by ctripcorp.
the class DefaultRedisMasterReplication method createPsync.
@Override
protected Psync createPsync() {
Psync psync = new DefaultPsync(clientPool, redisMaster.masterEndPoint(), redisMaster.getReplicationStoreManager(), scheduled);
psync.addPsyncObserver(this);
psync.addPsyncObserver(redisKeeperServer);
return psync;
}
use of com.ctrip.xpipe.redis.core.protocal.cmd.DefaultPsync in project x-pipe by ctripcorp.
the class PsyncTest method beforePsyncTest.
@Before
public void beforePsyncTest() throws Exception {
masterOffset = (long) randomInt(0, Integer.MAX_VALUE - 1);
replicationStoreManager = createReplicationStoreManager();
LifecycleHelper.initializeIfPossible(replicationStoreManager);
replicationStore = (DefaultReplicationStore) replicationStoreManager.create();
SimpleObjectPool<NettyClient> clientPool = NettyPoolUtil.createNettyPool(new InetSocketAddress("127.0.0.1", 1234));
psync = new DefaultPsync(clientPool, new DefaultEndPoint("127.0.0.1", 1234), replicationStoreManager, scheduled);
psync.future().addListener(new CommandFutureListener<Object>() {
@Override
public void operationComplete(CommandFuture<Object> commandFuture) throws Exception {
if (!commandFuture.isSuccess()) {
logger.error("[operationComplete]", commandFuture.cause());
}
}
});
}
Aggregations