use of com.ctrip.xpipe.redis.core.meta.impl.DefaultXpipeMetaManager in project x-pipe by ctripcorp.
the class ConfigCheck method fromXpipe.
private CheckCluster fromXpipe(XpipeMeta xpipeMeta, String checkCluster) {
XpipeMetaManager xpm = new DefaultXpipeMetaManager(xpipeMeta);
CheckCluster result = new CheckCluster(checkCluster);
for (String dc : dcs) {
ClusterMeta clusterMeta = xpm.getClusterMeta(dc, checkCluster);
if (clusterMeta == null) {
continue;
}
for (ShardMeta shardMeta : clusterMeta.getShards().values()) {
CheckShard orShard = result.getOrCreate(shardMeta.getId());
shardMeta.getRedises().forEach(redis -> {
orShard.addRedis(new CheckRedis(redis.getIp(), redis.getPort(), dc));
});
}
}
return result;
}
use of com.ctrip.xpipe.redis.core.meta.impl.DefaultXpipeMetaManager in project x-pipe by ctripcorp.
the class ClientConfigMonitor method fromXPipe.
private CheckCluster fromXPipe(XpipeMeta xpipeMeta, String checkCluster) {
XpipeMetaManager xpm = new DefaultXpipeMetaManager(xpipeMeta);
CheckCluster result = new CheckCluster(checkCluster);
for (String dc : xpipeMeta.getDcs().keySet()) {
ClusterMeta clusterMeta = xpm.getClusterMeta(dc, checkCluster);
if (clusterMeta == null) {
continue;
}
for (ShardMeta shardMeta : clusterMeta.getShards().values()) {
CheckShard orShard = result.getOrCreate(shardMeta.getId());
shardMeta.getRedises().forEach(redis -> {
orShard.addRedis(new CheckRedis(redis.getIp(), redis.getPort(), dc));
});
}
}
return result;
}
Aggregations