use of org.openkilda.wfm.topology.ping.model.FlowObserver in project open-kilda by telstra.
the class FailReporter method handlePing.
private void handlePing(Tuple input) throws PipelineException {
PingContext pingContext = pullPingContext(input);
if (pingContext.isPermanentError()) {
log.warn("Do not include permanent ping error in report ({})", pingContext);
return;
}
FlowObserver flowObserver = this.flowsStatusMap.computeIfAbsent(pingContext.getFlowId(), k -> new FlowObserver(pingContext.getFlowId(), pingStatusBuilder));
flowObserver.update(pingContext);
}
use of org.openkilda.wfm.topology.ping.model.FlowObserver in project open-kilda by telstra.
the class FailReporter method report.
private void report(Tuple input, String flowId, FlowObserver flowObserver, State state) throws PipelineException {
String logMessage = String.format("{FLOW-PING} Flow %s become %s", flowId, state);
if (state != State.OPERATIONAL) {
String cookies = flowObserver.getFlowTreadsInState(state).stream().map(cookie -> String.format("0x%016x", cookie)).collect(Collectors.joining(", "));
if (!cookies.isEmpty()) {
logMessage += String.format("(%s)", cookies);
}
}
log.info(logMessage);
Values output = new Values(new PingReport(flowId, state), pullContext(input));
getOutput().emit(input, output);
}
use of org.openkilda.wfm.topology.ping.model.FlowObserver in project open-kilda by telstra.
the class FailReporter method handleTick.
private void handleTick(Tuple input) throws PipelineException {
final long now = input.getLongByField(MonotonicTick.FIELD_ID_TIME_MILLIS);
for (Iterator<Entry<String, FlowObserver>> iterator = flowsStatusMap.entrySet().iterator(); iterator.hasNext(); ) {
Entry<String, FlowObserver> entry = iterator.next();
FlowObserver flowObserver = entry.getValue();
final String flowId = entry.getKey();
if (flowObserver.isGarbage()) {
iterator.remove();
log.info("Remove flow observer (flowId: {})", flowId);
continue;
}
State state = flowObserver.timeTick(now);
if (state != null) {
report(input, flowId, flowObserver, state);
}
}
}
use of org.openkilda.wfm.topology.ping.model.FlowObserver in project open-kilda by telstra.
the class FailReporter method handleCacheExpiration.
private void handleCacheExpiration(Tuple input) throws PipelineException {
Flow ref = pullFlow(input);
FlowObserver status = flowsStatusMap.get(ref.getFlowId());
if (status != null) {
status.remove(ref.getForwardPath().getCookie().getValue());
status.remove(ref.getReversePath().getCookie().getValue());
}
}
Aggregations