Search in sources :

Example 11 with XconnectEndpoint

use of org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint in project trellis-control by opennetworkinglab.

the class XconnectManager method revokeXConnect.

/**
 * Revokes XConnect groups and flows for given key.
 *
 * @param key       XConnect key
 * @param endpoints XConnect endpoints
 */
private void revokeXConnect(XconnectKey key, Set<XconnectEndpoint> endpoints) {
    if (!srService.shouldProgram(key.deviceId())) {
        log.debug("Abort revoking XConnect {}: {}", key, ERROR_NOT_LEADER);
        return;
    }
    revokeFilter(key, endpoints);
    int nextId = Versioned.valueOrElse(xconnectNextObjStore.get(key), -1);
    if (nextId != -1) {
        revokeFwd(key, nextId, null);
        revokeNext(key, endpoints, nextId, null);
    } else {
        log.warn("NextObj for {} does not exist in the store.", key);
    }
    revokeFilter(key, endpoints);
    revokeAcl(key);
}
Also used : ConnectPoint(org.onosproject.net.ConnectPoint) XconnectLoadBalancerEndpoint(org.onosproject.segmentrouting.xconnect.api.XconnectLoadBalancerEndpoint) XconnectEndpoint(org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint) XconnectPortEndpoint(org.onosproject.segmentrouting.xconnect.api.XconnectPortEndpoint)

Example 12 with XconnectEndpoint

use of org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint in project trellis-control by opennetworkinglab.

the class XconnectManager method dequeue.

// Invalidate the cache and re-start the xconnect installation
private void dequeue(PortLoadBalancerId portLoadBalancerId) {
    XconnectKey xconnectKey = portLoadBalancerCache.getIfPresent(portLoadBalancerId);
    if (xconnectKey == null) {
        log.trace("{} not present in the cache", portLoadBalancerId);
        return;
    }
    log.debug("Dequeue {}", portLoadBalancerId);
    portLoadBalancerCache.invalidate(portLoadBalancerId);
    Set<XconnectEndpoint> endpoints = Versioned.valueOrNull(xconnectStore.get(xconnectKey));
    if (endpoints == null || endpoints.isEmpty()) {
        log.warn("Endpoints not found for XConnect {}", xconnectKey);
        return;
    }
    populateXConnect(xconnectKey, endpoints);
    log.trace("PortLoadBalancer cache size {}", portLoadBalancerCache.size());
}
Also used : XconnectEndpoint(org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint) XconnectKey(org.onosproject.segmentrouting.xconnect.api.XconnectKey)

Aggregations

XconnectEndpoint (org.onosproject.segmentrouting.xconnect.api.XconnectEndpoint)12 XconnectLoadBalancerEndpoint (org.onosproject.segmentrouting.xconnect.api.XconnectLoadBalancerEndpoint)8 XconnectPortEndpoint (org.onosproject.segmentrouting.xconnect.api.XconnectPortEndpoint)8 ConnectPoint (org.onosproject.net.ConnectPoint)7 RemovalNotification (com.google.common.cache.RemovalNotification)6 ImmutableList (com.google.common.collect.ImmutableList)6 List (java.util.List)6 Cache (com.google.common.cache.Cache)5 CacheBuilder (com.google.common.cache.CacheBuilder)5 ImmutableMap (com.google.common.collect.ImmutableMap)5 ImmutableSet (com.google.common.collect.ImmutableSet)5 Lists (com.google.common.collect.Lists)5 Sets (com.google.common.collect.Sets)5 Serializable (java.io.Serializable)5 Collections (java.util.Collections)5 Iterator (java.util.Iterator)5 Optional (java.util.Optional)5 Set (java.util.Set)5 CompletableFuture (java.util.concurrent.CompletableFuture)5 ExecutorService (java.util.concurrent.ExecutorService)5