@Test public void testDcsInterestedNotChange() { ClusterMeta cluster = getDcMeta("oy").findCluster("cluster4"); ClusterMeta newCluster = MetaClone.clone(cluster); newCluster.setDcs("rb"); manager.visitModified(new ClusterMetaComparator(cluster, newCluster)); Mockito.verify(instanceManager, never()).getOrCreate(any()); Mockito.verify(instanceManager, never()).remove(any()); cluster = getDcMeta("oy").findCluster("cluster3"); newCluster = MetaClone.clone(cluster); newCluster.setDcs("jq,oy,rb"); manager.visitModified(new ClusterMetaComparator(cluster, newCluster)); Mockito.verify(instanceManager, never()).getOrCreate(any()); Mockito.verify(instanceManager, never()).remove(any()); }
@Override public void visitModified(MetaComparator comparator) { ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) comparator; updateDcInterested(clusterMetaComparator); clusterMetaComparator.accept(new ClusterMetaComparatorVisitor(addConsumer, removeConsumer, redisChanged)); }
DefaultDcMetaChangeManager extends AbstractStartStoppable implements DcMetaChangeManager, MetaComparatorVisitor<ClusterMeta> { @Override public void visitModified(MetaComparator comparator) { ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) comparator; updateDcInterested(clusterMetaComparator); clusterMetaComparator.accept(new ClusterMetaComparatorVisitor(addConsumer, removeConsumer, redisChanged)); } }
DefaultDcMetaChangeManager extends AbstractStartStoppable implements DcMetaChangeManager, MetaComparatorVisitor<ClusterMeta> { @Override public void visitModified(MetaComparator comparator) { ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) comparator; updateDcInterested(clusterMetaComparator); clusterMetaComparator.accept(new ClusterMetaComparatorVisitor(addConsumer, removeConsumer, redisChanged)); } DefaultDcMetaChangeManager(HealthCheckInstanceManager instanceManager); }
DefaultDcMetaChangeManager extends AbstractStartStoppable implements DcMetaChangeManager, MetaComparatorVisitor<ClusterMeta> { @Override public void visitModified(MetaComparator comparator) { ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) comparator; updateDcInterested(clusterMetaComparator); clusterMetaComparator.accept(new ClusterMetaComparatorVisitor(addConsumer, removeConsumer, redisChanged)); } DefaultDcMetaChangeManager(HealthCheckInstanceManager instanceManager); @Override void compare(DcMeta future); @Override void visitAdded(ClusterMeta added); @Override void visitModified(MetaComparator comparator); @Override void visitRemoved(ClusterMeta removed); }
DefaultDcMetaChangeManager extends AbstractStartStoppable implements DcMetaChangeManager, MetaComparatorVisitor<ClusterMeta> { @Override public void visitModified(MetaComparator comparator) { ClusterMetaComparator clusterMetaComparator = (ClusterMetaComparator) comparator; updateDcInterested(clusterMetaComparator); clusterMetaComparator.accept(new ClusterMetaComparatorVisitor(addConsumer, removeConsumer, redisChanged)); } DefaultDcMetaChangeManager(HealthCheckInstanceManager instanceManager); @Override void compare(DcMeta future); @Override void visitAdded(ClusterMeta added); @Override void visitModified(MetaComparator comparator); @Override void visitRemoved(ClusterMeta removed);  }