use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class IslFsm method createIsl.
private Isl createIsl(Anchor source, Anchor dest, Instant timeNow) {
final Endpoint sourceEndpoint = source.getEndpoint();
final Endpoint destEndpoint = dest.getEndpoint();
IslBuilder islBuilder = Isl.builder().srcSwitch(source.getSw()).srcPort(sourceEndpoint.getPortNumber()).destSwitch(dest.getSw()).destPort(destEndpoint.getPortNumber()).underMaintenance(source.getSw().isUnderMaintenance() || dest.getSw().isUnderMaintenance());
initializeFromLinkProps(sourceEndpoint, destEndpoint, islBuilder);
Isl link = islBuilder.build();
log.info("Create new DB object (prefilled): {}", link);
islRepository.add(link);
return link;
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class IslFsm method sendInstallResources.
private void sendInstallResources(IIslCarrier carrier) {
final Endpoint source = reference.getSource();
final Endpoint dest = reference.getDest();
sendInstallResources(carrier, source, dest);
sendInstallResources(carrier, dest, source);
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkTopologyDashboardLogger method onIslUpDownMoved.
private void onIslUpDownMoved(IslReference reference, String event, String statusDetails) {
Map<String, String> context = makeContextTemplate("isl");
populateEvent(context, event);
Endpoint source = reference.getSource();
context.put("src_switch", source.getDatapath().toString());
context.put("src_port", String.valueOf(source.getPortNumber()));
context.put("src_switch_port", source.toString());
Endpoint dest = reference.getDest();
context.put("dst_switch", dest.getDatapath().toString());
context.put("dst_port", String.valueOf(dest.getPortNumber()));
context.put("dst_switch_port", dest.toString());
String message = String.format("ISL %s changed status to: %s [%s]", reference, event, statusDetails);
invokeLogger(Level.INFO, message, context);
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkRoundTripDecisionMakerService method tick.
/**
* Process time tick - locate expired entries and emit round trip INACTIVE events for them.
*/
public void tick() {
Instant now = clock.instant();
SortedMap<Instant, Set<Endpoint>> range = timeouts.headMap(now);
Set<Endpoint> processed = new HashSet<>();
for (Set<Endpoint> batch : range.values()) {
for (Endpoint endpoint : batch) {
if (processed.contains(endpoint)) {
continue;
}
processed.add(endpoint);
checkExpiration(now, endpoint);
}
}
range.clear();
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class NetworkRoundTripDecisionMakerService method discovered.
/**
* Register/update round trip tracking data for specific endpoint.
*/
public void discovered(Endpoint endpoint, long packetId) {
Entry entry = entries.get(endpoint);
if (entry != null && packetId < entry.getLastSeenPacketId()) {
log.debug("Ignore staled round trip discovery on {} (packet_id: {})", endpoint, packetId);
return;
}
Instant expireAt = clock.instant().plus(expireDelay);
entries.put(endpoint, new Entry(packetId, expireAt));
timeouts.computeIfAbsent(expireAt, key -> new HashSet<>()).add(endpoint);
if (entry == null) {
log.info("Register round trip status entry for {}", endpoint);
}
// Emits each registered round trip event. Some ISLs monitor can ignore some round trip ACTIVATE events as part
// of race conditions prevention fight.
carrier.linkRoundTripActive(endpoint);
}
Aggregations