Search in sources :

Example 6 with PrimaryDcChangeMessage

use of com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage in project x-pipe by ctripcorp.

the class BecomePrimaryActionTest method test.

@Test
public void test() throws Exception {
    BecomePrimaryAction becomePrimaryAction = new BecomePrimaryAction(dcMetaCache, currentMetaManager, sentinelManager, offsetWaiter, new ExecutionLog(getTestName()), getXpipeNettyClientKeyedObjectPool(), newMasterChooser, scheduled, executors);
    PrimaryDcChangeMessage message = becomePrimaryAction.changePrimaryDc(getClusterId(), getShardId(), newPrimaryDc, new MasterInfo());
    logger.info("{}", message);
}
Also used : MasterInfo(com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo) ExecutionLog(com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog) BecomePrimaryAction(com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomePrimaryAction) PrimaryDcChangeMessage(com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage) Test(org.junit.Test) AbstractMetaServerTest(com.ctrip.xpipe.redis.meta.server.AbstractMetaServerTest)

Example 7 with PrimaryDcChangeMessage

use of com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage 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);
}
Also used : MasterInfo(com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo) ExecutionLog(com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog) BecomeBackupAction(com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomeBackupAction) PrimaryDcChangeMessage(com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage) Test(org.junit.Test) AbstractMetaServerTest(com.ctrip.xpipe.redis.meta.server.AbstractMetaServerTest)

Aggregations

PrimaryDcChangeMessage (com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage)7 MasterInfo (com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo)4 Test (org.junit.Test)4 RedisMeta (com.ctrip.xpipe.redis.core.entity.RedisMeta)3 ExecutionLog (com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog)3 BecomeBackupAction (com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomeBackupAction)3 BecomePrimaryAction (com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomePrimaryAction)3 AbstractMetaServerTest (com.ctrip.xpipe.redis.meta.server.AbstractMetaServerTest)2 HostPort (com.ctrip.xpipe.endpoint.HostPort)1 KeeperMeta (com.ctrip.xpipe.redis.core.entity.KeeperMeta)1 MetaServerConsoleService (com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService)1 DefaultMetaServerConsoleService (com.ctrip.xpipe.redis.core.metaserver.impl.DefaultMetaServerConsoleService)1 TestMetaServer (com.ctrip.xpipe.redis.meta.server.TestMetaServer)1