use of com.ctrip.xpipe.redis.core.entity.XpipeMeta in project x-pipe by ctripcorp.
the class HealthChecker method warmup.
@VisibleForTesting
protected void warmup() {
int period = 1000;
XpipeMeta xpipeMeta = null;
while (xpipeMeta == null) {
log.info("[warmup] waiting for metaCache initialized");
try {
Thread.sleep(period);
xpipeMeta = metaCache.getXpipeMeta();
Thread.sleep(period);
} catch (Exception e) {
log.error("[warmup]", e);
}
}
try {
List<DcMeta> dcsToCheck = new LinkedList<>(xpipeMeta.getDcs().values());
for (DcMeta dc : dcsToCheck) {
dc.accept(healthCheckVisitor);
}
} catch (Exception e) {
log.error("[warmup] error: {}", e);
}
}
use of com.ctrip.xpipe.redis.core.entity.XpipeMeta in project x-pipe by ctripcorp.
the class ClientConfigMonitor method doCheck.
@Override
protected void doCheck() {
logger.info("[doCheck]");
XpipeMeta xpipeMeta = metaCache.getXpipeMeta();
Set<String> clusters = getClusters(xpipeMeta);
for (String cluster : clusters) {
try {
checkCluster(cluster, xpipeMeta);
} catch (Exception e) {
logger.info("[doCheck]" + cluster, e);
}
}
}
use of com.ctrip.xpipe.redis.core.entity.XpipeMeta in project x-pipe by ctripcorp.
the class MetaCloneTest method testCloneMultiTimes.
@Test
public void testCloneMultiTimes() {
int count = 1 << 1;
XpipeMeta xpipeMeta = getXpipeMeta();
DcMeta dcMeta = xpipeMeta.getDcs().values().iterator().next();
DcMeta clone = null;
for (int i = 0; i < count; i++) {
clone = MetaClone.clone(dcMeta);
}
}
use of com.ctrip.xpipe.redis.core.entity.XpipeMeta in project x-pipe by ctripcorp.
the class ClusterShardCounterTest method testCount.
@Test
public void testCount() {
XpipeMeta xpipeMeta = getXpipeMeta();
ClusterShardCounter counter = new ClusterShardCounter();
xpipeMeta.accept(counter);
logger.info("{}", counter.getClusters());
Assert.assertEquals(2, counter.getClusterCount());
Assert.assertEquals(2, counter.getShardCount());
}
Aggregations