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);
}
}
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);
}
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);
}
}
Aggregations