Search in sources :

Example 1 with DcMetaBuilder

use of com.ctrip.xpipe.redis.console.service.vo.DcMetaBuilder in project x-pipe by ctripcorp.

the class AdvancedDcMetaService method getDcMeta.

@Override
public DcMeta getDcMeta(String dcName) {
    DcTbl dcTbl = dcService.find(dcName);
    DcMeta dcMeta = new DcMeta().setId(dcName).setLastModifiedTime(dcTbl.getDcLastModifiedTime());
    ParallelCommandChain chain = new ParallelCommandChain(executors);
    chain.add(retry3TimesUntilSuccess(new GetAllSentinelCommand(dcMeta)));
    chain.add(retry3TimesUntilSuccess(new GetAllKeeperContainerCommand(dcMeta)));
    DcMetaBuilder builder = new DcMetaBuilder(dcMeta, dcTbl.getId(), executors, redisMetaService, dcClusterService, clusterMetaService, dcClusterShardService, dcService, factory);
    chain.add(retry3TimesUntilSuccess(builder));
    try {
        chain.execute().get();
    } catch (Exception e) {
        logger.error("[queryDcMeta] ", e);
    }
    return dcMeta;
}
Also used : ParallelCommandChain(com.ctrip.xpipe.command.ParallelCommandChain) DcTbl(com.ctrip.xpipe.redis.console.model.DcTbl) DcMetaBuilder(com.ctrip.xpipe.redis.console.service.vo.DcMetaBuilder) DcMeta(com.ctrip.xpipe.redis.core.entity.DcMeta)

Aggregations

ParallelCommandChain (com.ctrip.xpipe.command.ParallelCommandChain)1 DcTbl (com.ctrip.xpipe.redis.console.model.DcTbl)1 DcMetaBuilder (com.ctrip.xpipe.redis.console.service.vo.DcMetaBuilder)1 DcMeta (com.ctrip.xpipe.redis.core.entity.DcMeta)1