use of com.ctrip.xpipe.redis.core.protocal.pojo.MasterRole in project x-pipe by ctripcorp.
the class FirstNewMasterChooserTest method startSlaveFakeRedis.
private Server startSlaveFakeRedis(Integer port, SERVER_ROLE serverRole) throws Exception {
Role role = null;
if (serverRole == SERVER_ROLE.MASTER) {
role = new MasterRole();
} else {
role = new SlaveRole(serverRole, "localhost", port, MASTER_STATE.REDIS_REPL_CONNECT, 0L);
}
Server server = startServer(port, ByteBufUtils.readToString(role.format()));
return server;
}
Aggregations