Search in sources :

Example 1 with IslEndpointPollStatus

use of org.openkilda.wfm.topology.network.model.IslEndpointPollStatus in project open-kilda by telstra.

the class DiscoveryPollMonitor method actualFlush.

@Override
protected void actualFlush(Endpoint endpoint, Isl persistentView) {
    IslEndpointPollStatus pollStatus = discoveryData.get(endpoint);
    IslDataHolder islData = makeAggregatedIslData(pollStatus.getIslData(), discoveryData.get(reference.getOpposite(endpoint)).getIslData());
    if (islData == null) {
        log.error("There is no ISL data available for {}, unable to calculate available_bandwidth", reference);
    } else {
        persistentView.setSpeed(islData.getSpeed());
        persistentView.setMaxBandwidth(islData.getMaximumBandwidth());
        persistentView.setDefaultMaxBandwidth(islData.getEffectiveMaximumBandwidth());
    }
    persistentView.setActualStatus(pollStatus.getStatus());
}
Also used : IslEndpointPollStatus(org.openkilda.wfm.topology.network.model.IslEndpointPollStatus) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder)

Example 2 with IslEndpointPollStatus

use of org.openkilda.wfm.topology.network.model.IslEndpointPollStatus in project open-kilda by telstra.

the class DiscoveryPollMonitor method actualUpdate.

@Override
public void actualUpdate(IslFsmEvent event, IslFsmContext context) {
    Endpoint endpoint = context.getEndpoint();
    IslEndpointPollStatus update = discoveryData.get(endpoint);
    switch(event) {
        case ISL_UP:
            update = new IslEndpointPollStatus(context.getIslData(), IslStatus.ACTIVE);
            log.info("ISL {} data update - bind:{} - {}", reference, endpoint, update.getIslData());
            break;
        case ISL_DOWN:
            update = new IslEndpointPollStatus(update.getIslData(), IslStatus.INACTIVE);
            break;
        case ISL_MOVE:
            // We must track MOVED state, because poll and moved monitor save it's status
            // inside same field {@link Isl.actualStatus}. In other case we will rewrite MOVED state
            // saved by {@link DiscoveryMovedMonitor} with our ovn "vision".
            update = new IslEndpointPollStatus(update.getIslData(), IslStatus.MOVED);
            break;
        default:
    }
    discoveryData.put(endpoint, update);
}
Also used : IslEndpointPollStatus(org.openkilda.wfm.topology.network.model.IslEndpointPollStatus) Endpoint(org.openkilda.wfm.share.model.Endpoint)

Example 3 with IslEndpointPollStatus

use of org.openkilda.wfm.topology.network.model.IslEndpointPollStatus in project open-kilda by telstra.

the class DiscoveryPollMonitor method load.

@Override
public void load(Endpoint endpoint, Isl persistentView) {
    super.load(endpoint, persistentView);
    IslDataHolder islData = new IslDataHolder(persistentView);
    IslEndpointPollStatus status = new IslEndpointPollStatus(islData, persistentView.getStatus());
    discoveryData.put(endpoint, status);
    cache.put(endpoint, status);
}
Also used : IslEndpointPollStatus(org.openkilda.wfm.topology.network.model.IslEndpointPollStatus) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder)

Aggregations

IslEndpointPollStatus (org.openkilda.wfm.topology.network.model.IslEndpointPollStatus)3 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)2 Endpoint (org.openkilda.wfm.share.model.Endpoint)1