use of com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo in project x-pipe by ctripcorp.
the class DefaultOffsetwaiterTest method testWaitforSlaveDifferentReplid.
@Test
public void testWaitforSlaveDifferentReplid() throws Exception {
MasterInfo masterInfo = new MasterInfo(RunidGenerator.DEFAULT.generateRunid(), 1L);
startServer(port, toRedisProtocalString("# Replication\r\n" + "role:slave\r\n" + "master_host:127.0.0.1\r\n" + "master_port:6379\r\n" + "master_link_status:up\r\n" + "master_last_io_seconds_ago:8\r\n" + "master_sync_in_progress:0\r\n" + "slave_repl_offset:13202\r\n" + "slave_priority:100\r\n" + "slave_read_only:1\r\n" + "connected_slaves:0\r\n" + "master_replid:ebe8dc36b4a9901af79ac117fa55d45e3dbb92a1\r\n" + "master_replid2:0000000000000000000000000000000000000000\r\n" + "master_repl_offset:13202\r\n" + "second_repl_offset:-1\r\n" + "repl_backlog_active:1\r\n" + "repl_backlog_size:1048576\r\n" + "repl_backlog_first_byte_offset:1\r\n" + "repl_backlog_histlen:13202"));
Assert.assertFalse(offsetwaiter.tryWaitfor(new HostPort(host, port), masterInfo, executionLog));
}
use of com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo in project x-pipe by ctripcorp.
the class BecomeBackupActionTest method test.
@Test
public void test() throws Exception {
BecomeBackupAction becomeBackupAction = new BecomeBackupAction(dcMetaCache, currentMetaManager, sentinelManager, new ExecutionLog(currentTestName()), getXpipeNettyClientKeyedObjectPool(), multiDcService, scheduled, executors);
PrimaryDcChangeMessage message = becomeBackupAction.changePrimaryDc(getClusterId(), getShardId(), newPrimaryDc, new MasterInfo());
logger.info("{}", message);
}
Aggregations