Search in sources :

Example 1 with MasterRole

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;
}
Also used : Role(com.ctrip.xpipe.redis.core.protocal.pojo.Role) SlaveRole(com.ctrip.xpipe.redis.core.protocal.pojo.SlaveRole) MasterRole(com.ctrip.xpipe.redis.core.protocal.pojo.MasterRole) SlaveRole(com.ctrip.xpipe.redis.core.protocal.pojo.SlaveRole) Server(com.ctrip.xpipe.simpleserver.Server) MasterRole(com.ctrip.xpipe.redis.core.protocal.pojo.MasterRole)

Aggregations

MasterRole (com.ctrip.xpipe.redis.core.protocal.pojo.MasterRole)1 Role (com.ctrip.xpipe.redis.core.protocal.pojo.Role)1 SlaveRole (com.ctrip.xpipe.redis.core.protocal.pojo.SlaveRole)1 Server (com.ctrip.xpipe.simpleserver.Server)1