Search in sources :

Example 1 with TimeoutDescriptor

use of org.openkilda.wfm.topology.ping.model.TimeoutDescriptor in project open-kilda by telstra.

the class TimeoutManager method handleResponse.

private void handleResponse(Tuple input) throws PipelineException {
    PingResponse response = pullPingResponse(input);
    log.debug("Got ping response pingId={}", response.getPingId());
    TimeoutDescriptor descriptor = pendingPings.remove(response.getPingId());
    if (descriptor == null) {
        log.debug("There is no pending request matching ping response {} (multiple responses are expected if switch " + "connected to multiple regions)", response.getPingId());
    } else {
        cancelTimeout(descriptor);
        emitResponse(input, descriptor, response);
    }
}
Also used : TimeoutDescriptor(org.openkilda.wfm.topology.ping.model.TimeoutDescriptor) PingResponse(org.openkilda.messaging.floodlight.response.PingResponse)

Example 2 with TimeoutDescriptor

use of org.openkilda.wfm.topology.ping.model.TimeoutDescriptor in project open-kilda by telstra.

the class TimeoutManager method scheduleTimeout.

private void scheduleTimeout(PingContext pingContext, CommandContext commandContext) {
    long timeout = pingTimeout;
    if (pingContext.getTimeout() != null) {
        timeout = pingContext.getTimeout();
    }
    log.debug("Schedule timeout for {} in {} ms", pingContext, timeout);
    long expireAt = System.currentTimeMillis() + timeout;
    TimeoutDescriptor descriptor = new TimeoutDescriptor(expireAt, pingContext, commandContext);
    pendingPings.put(pingContext.getPingId(), descriptor);
}
Also used : TimeoutDescriptor(org.openkilda.wfm.topology.ping.model.TimeoutDescriptor)

Example 3 with TimeoutDescriptor

use of org.openkilda.wfm.topology.ping.model.TimeoutDescriptor in project open-kilda by telstra.

the class TimeoutManager method handleTimeTick.

private void handleTimeTick(Tuple input) {
    final long now = input.getLongByField(MonotonicTick.FIELD_ID_TIME_MILLIS);
    log.debug("Pending ping queue size: {}", pendingPings.size());
    for (TimeoutDescriptor descriptor : pendingPings.expire(now)) {
        emitTimeout(input, descriptor, now);
    }
}
Also used : TimeoutDescriptor(org.openkilda.wfm.topology.ping.model.TimeoutDescriptor)

Aggregations

TimeoutDescriptor (org.openkilda.wfm.topology.ping.model.TimeoutDescriptor)3 PingResponse (org.openkilda.messaging.floodlight.response.PingResponse)1