use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkWatcherService method discovery.
/**
* Consume discovery event.
*/
public void discovery(IslInfoData discoveryEvent) {
Endpoint source = new Endpoint(discoveryEvent.getSource());
Long packetId = discoveryEvent.getPacketId();
if (packetId == null) {
log.error("Got corrupted discovery packet into {} - packetId field is empty", source);
} else {
discovery(discoveryEvent, Packet.of(source, packetId));
}
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkWatchListService method tick.
/**
* Consume timer tick.
*/
@VisibleForTesting
void tick(long tickTime) {
SortedMap<Long, Set<Endpoint>> range = timeouts.subMap(0L, tickTime + 1);
if (!range.isEmpty()) {
Map<Endpoint, WatchListEntry> renew = new HashMap<>();
for (Set<Endpoint> endpointSet : range.values()) {
for (Endpoint endpoint : endpointSet) {
WatchListEntry watchListEntry = endpoints.get(endpoint);
if (watchListEntry != null && renew.put(endpoint, watchListEntry) == null) {
carrier.discoveryRequest(endpoint, tickTime);
}
}
}
range.clear();
renew.forEach((endpoint, watchListEntry) -> addTimeout(endpoint, tickTime + calculateTimeout(endpoint)));
}
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkWatchListService method activate.
/**
* Handles topology activation event.
*/
public void activate() {
long currentTime = now();
for (Endpoint entry : endpoints.keySet()) {
carrier.discoveryRequest(entry, currentTime);
addTimeout(entry, currentTime + genericTickPeriod);
}
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class DecisionMakerHandler method makeDefaultTuple.
// Private
private Values makeDefaultTuple(PortCommand command) {
Endpoint endpoint = command.getEndpoint();
CommandContext context = forkContext("DM", endpoint.toString());
return new Values(endpoint.getDatapath(), endpoint.getPortNumber(), command, context);
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkIslServiceTest method setupIslStorageStub.
private void setupIslStorageStub() {
doAnswer(invocation -> {
Endpoint ingress = Endpoint.of(invocation.getArgument(0), invocation.getArgument(1));
Endpoint egress = Endpoint.of(invocation.getArgument(2), invocation.getArgument(3));
return islStorage.lookup(ingress, egress);
}).when(islRepository).findByEndpoints(any(SwitchId.class), anyInt(), any(SwitchId.class), anyInt());
doAnswer(invocation -> {
Isl payload = invocation.getArgument(0);
islStorage.save(payload);
return null;
}).when(islRepository).add(any(Isl.class));
}
Aggregations