public void discoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) { super.discoveryRequestReceived(sender, logical_name, physical_addr); if(physical_addr != null && !initial_hosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); }
public Object down(Event evt) { Object retval=super.down(evt); switch(evt.getType()) { case Event.VIEW_CHANGE: for(Address logical_addr: view.getMembersRaw()) { PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, logical_addr)); if(physical_addr != null && !initial_hosts.contains(physical_addr)) { dynamic_hosts.addIfAbsent(physical_addr); } } break; case Event.ADD_PHYSICAL_ADDRESS: Tuple<Address,PhysicalAddress> tuple=evt.getArg(); PhysicalAddress physical_addr=tuple.getVal2(); if(physical_addr != null && !initial_hosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); break; } return retval; }
public void discoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) { super.discoveryRequestReceived(sender, logical_name, physical_addr); if (physical_addr != null) { if (!kubernetesHosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); } }
public void discoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) { super.discoveryRequestReceived(sender, logical_name, physical_addr); if(physical_addr != null && !initial_hosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); }
public void discoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) { super.discoveryRequestReceived(sender, logical_name, physical_addr); log.debug("Received discovery from: %s, IP: %s", sender.toString(), physical_addr.printIpAddress()); if (physical_addr != null) discovered_hosts.addIfAbsent(sender); }
public Object down(Event evt) { Object retval = super.down(evt); switch (evt.getType()) { case Event.VIEW_CHANGE: for (Address logical_addr : members) { PhysicalAddress physical_addr = (PhysicalAddress) down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, logical_addr)); if (physical_addr != null && !kubernetesHosts.contains(physical_addr)) { dynamic_hosts.addIfAbsent(physical_addr); } } break; case Event.SET_PHYSICAL_ADDRESS: Tuple<Address, PhysicalAddress> tuple = (Tuple<Address, PhysicalAddress>) evt.getArg(); PhysicalAddress physical_addr = tuple.getVal2(); if (physical_addr != null && !kubernetesHosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); break; } return retval; }
public Object down(Event evt) { Object retval=super.down(evt); switch(evt.getType()) { case Event.VIEW_CHANGE: for(Address logical_addr: view.getMembersRaw()) { PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, logical_addr)); if(physical_addr != null && !initial_hosts.contains(physical_addr)) { dynamic_hosts.addIfAbsent(physical_addr); } } break; case Event.ADD_PHYSICAL_ADDRESS: Tuple<Address,PhysicalAddress> tuple=evt.getArg(); PhysicalAddress physical_addr=tuple.getVal2(); if(physical_addr != null && !initial_hosts.contains(physical_addr)) dynamic_hosts.addIfAbsent(physical_addr); break; } return retval; }
@Override public Object down(Event evt) { Object retval = super.down(evt); switch (evt.getType()) { case Event.VIEW_CHANGE: for (Address logical_addr : view.getMembersRaw()) { PhysicalAddress physical_addr = (PhysicalAddress) down_prot .down(new Event(Event.GET_PHYSICAL_ADDRESS, logical_addr)); if (physical_addr != null) { discovered_hosts.addIfAbsent(physical_addr); } } break; case Event.SUSPECT: Collection<Address> addresses = evt.getArg() instanceof Address ? Collections.singletonList(evt.arg()) : evt.arg(); discovered_hosts.removeAll(addresses); break; case Event.ADD_PHYSICAL_ADDRESS: Tuple<Address, PhysicalAddress> tuple = evt.getArg(); PhysicalAddress physical_addr = tuple.getVal2(); if (physical_addr != null) discovered_hosts.addIfAbsent(physical_addr); break; } return retval; }
discovered_hosts.addIfAbsent(addressToBeAdded);