Search in sources :

Example 6 with ExecutionLog

use of com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog in project x-pipe by ctripcorp.

the class DefaultSentinelManagerTest method beforeDefaultSentinelManagerTest.

@Before
public void beforeDefaultSentinelManagerTest() throws Exception {
    sentinelManager = new DefaultSentinelManager(dcMetaCache, getXpipeNettyClientKeyedObjectPool());
    executionLog = new ExecutionLog(currentTestName());
    redisMaster = new RedisMeta().setIp("127.0.0.1").setPort(port);
    when(dcMetaCache.getSentinelMonitorName(getClusterId(), getShardId())).thenReturn(sentinelMonitorName);
    when(dcMetaCache.getSentinel(getClusterId(), getShardId())).thenReturn(new SentinelMeta().setAddress(allSentinels));
}
Also used : ExecutionLog(com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog) SentinelMeta(com.ctrip.xpipe.redis.core.entity.SentinelMeta) RedisMeta(com.ctrip.xpipe.redis.core.entity.RedisMeta) DefaultSentinelManager(com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultSentinelManager) Before(org.junit.Before)

Example 7 with ExecutionLog

use of com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog 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

ExecutionLog (com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog)7 MasterInfo (com.ctrip.xpipe.redis.core.protocal.pojo.MasterInfo)4 PrimaryDcChangeMessage (com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService.PrimaryDcChangeMessage)3 Test (org.junit.Test)3 HostPort (com.ctrip.xpipe.endpoint.HostPort)2 RedisMeta (com.ctrip.xpipe.redis.core.entity.RedisMeta)2 MetaServerConsoleService (com.ctrip.xpipe.redis.core.metaserver.MetaServerConsoleService)2 AbstractMetaServerTest (com.ctrip.xpipe.redis.meta.server.AbstractMetaServerTest)2 BecomeBackupAction (com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomeBackupAction)2 BecomePrimaryAction (com.ctrip.xpipe.redis.meta.server.dcchange.impl.BecomePrimaryAction)2 Before (org.junit.Before)2 SentinelMeta (com.ctrip.xpipe.redis.core.entity.SentinelMeta)1 RedisInfo (com.ctrip.xpipe.redis.core.protocal.pojo.RedisInfo)1 UnitTestServerConfig (com.ctrip.xpipe.redis.meta.server.config.UnitTestServerConfig)1 DefaultOffsetwaiter (com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultOffsetwaiter)1 DefaultSentinelManager (com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultSentinelManager)1