use of com.ctrip.xpipe.redis.core.meta.MetaComparator in project x-pipe by ctripcorp.
the class DefaultCurrentMetaManager method dcMetaChange.
private void dcMetaChange(DcMetaComparator comparator) {
for (ClusterMeta clusterMeta : comparator.getAdded()) {
if (currentClusterServer.hasKey(clusterMeta.getId())) {
addCluster(clusterMeta.getId());
} else {
logger.info("[dcMetaChange][add][not interested]{}", clusterMeta.getId());
}
}
for (ClusterMeta clusterMeta : comparator.getRemoved()) {
if (currentClusterServer.hasKey(clusterMeta.getId())) {
destroyCluster(clusterMeta);
} else {
logger.info("[dcMetaChange][destroy][not interested]{}", clusterMeta.getId());
}
}
for (@SuppressWarnings("rawtypes") MetaComparator changedComparator : comparator.getMofified()) {
ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) changedComparator;
String clusterId = clusterMetaComparator.getCurrent().getId();
if (currentClusterServer.hasKey(clusterId)) {
handleClusterChanged(clusterMetaComparator);
} else {
logger.info("[dcMetaChange][change][not interested]{}", clusterId);
}
}
}
Aggregations