@Test public void createThreeNodeCluster() { title("createThreeNodeCluster"); cache.addOrUpdateClusterMember(CNODE_1); dispatcher.assertLast(Type.CLUSTER_MEMBER_ADDED_OR_UPDATED, C1); cache.addOrUpdateClusterMember(CNODE_2); dispatcher.assertLast(Type.CLUSTER_MEMBER_ADDED_OR_UPDATED, C2); cache.addOrUpdateClusterMember(CNODE_3); dispatcher.assertLast(Type.CLUSTER_MEMBER_ADDED_OR_UPDATED, C3); dispatcher.assertEventCount(3); print(cache); }
void addOrUpdateClusterMember(ControllerNode cnode) { NodeId id = cnode.id(); UiClusterMember member = uiTopology.findClusterMember(id); if (member == null) { member = addNewClusterMember(cnode); } updateClusterMember(member); postEvent(CLUSTER_MEMBER_ADDED_OR_UPDATED, member); }
ModelCache { void addOrUpdateClusterMember(ControllerNode cnode) { NodeId id = cnode.id(); UiClusterMember member = uiTopology.findClusterMember(id); if (member == null) { member = addNewClusterMember(cnode); } updateClusterMember(member); postEvent(CLUSTER_MEMBER_ADDED_OR_UPDATED, member); } }
ModelCache { void addOrUpdateClusterMember(ControllerNode cnode) { NodeId id = cnode.id(); UiClusterMember member = uiTopology.findClusterMember(id); if (member == null) { member = addNewClusterMember(cnode); } updateClusterMember(member); postEvent(CLUSTER_MEMBER_ADDED_OR_UPDATED, member); } ModelCache(ServiceBundle services, EventDispatcher eventDispatcher); }
ModelCache { void addOrUpdateClusterMember(ControllerNode cnode) { NodeId id = cnode.id(); UiClusterMember member = uiTopology.findClusterMember(id); if (member == null) { member = addNewClusterMember(cnode); } updateClusterMember(member); postEvent(CLUSTER_MEMBER_ADDED_OR_UPDATED, member); } ModelCache(ServiceBundle services, EventDispatcher eventDispatcher); @Override String toString(); String dumpString(); int clusterMemberCount(); int regionCount(); int deviceCount(); int linkCount(); int hostCount(); }
ModelCache { void addOrUpdateClusterMember(ControllerNode cnode) { NodeId id = cnode.id(); UiClusterMember member = uiTopology.findClusterMember(id); if (member == null) { member = addNewClusterMember(cnode); } updateClusterMember(member); postEvent(CLUSTER_MEMBER_ADDED_OR_UPDATED, member); } ModelCache(ServiceBundle services, EventDispatcher eventDispatcher); @Override String toString(); String dumpString(); int clusterMemberCount(); int regionCount(); int deviceCount(); int linkCount(); int hostCount();  }