Search in sources :

Example 1 with Endpoint

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);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) CommandContext(org.openkilda.wfm.CommandContext) Values(org.apache.storm.tuple.Values)

Example 2 with Endpoint

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)));
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Endpoint(org.openkilda.wfm.share.model.Endpoint) HashMap(java.util.HashMap) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 3 with 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);
    }
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint)

Example 4 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class SwitchHandler method makePortTuple.

private Values makePortTuple(PortCommand command) {
    Endpoint endpoint = command.getEndpoint();
    CommandContext context = forkContext(endpoint.toString());
    return new Values(endpoint.getDatapath(), endpoint.getPortNumber(), command, context);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) CommandContext(org.openkilda.wfm.CommandContext) Values(org.apache.storm.tuple.Values)

Example 5 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class CacheService method updateCache.

private Endpoint updateCache(Endpoint source) throws IslNotFoundException, IllegalIslStateException {
    Isl isl = getNotMovedIsl(source);
    Endpoint destination = Endpoint.of(isl.getDestSwitchId(), isl.getDestPort());
    cache.put(source, destination);
    cache.put(destination, source);
    return destination;
}
Also used : Isl(org.openkilda.model.Isl) Endpoint(org.openkilda.wfm.share.model.Endpoint)

Aggregations

Endpoint (org.openkilda.wfm.share.model.Endpoint)72 Test (org.junit.Test)33 Isl (org.openkilda.model.Isl)17 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)13 SwitchId (org.openkilda.model.SwitchId)10 Switch (org.openkilda.model.Switch)8 IslReference (org.openkilda.wfm.share.model.IslReference)8 PathNode (org.openkilda.messaging.info.event.PathNode)7 Instant (java.time.Instant)6 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)6 HashSet (java.util.HashSet)4 Set (java.util.Set)4 DiscoverIslCommandData (org.openkilda.messaging.command.discovery.DiscoverIslCommandData)4 IslNotFoundException (org.openkilda.wfm.error.IslNotFoundException)4 Values (org.apache.storm.tuple.Values)3 IslRoundTripLatency (org.openkilda.messaging.info.event.IslRoundTripLatency)3 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)3 CommandContext (org.openkilda.wfm.CommandContext)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 HashMap (java.util.HashMap)2