use of org.openkilda.messaging.model.PingReport.State 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.messaging.model.PingReport.State 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);
}
}
}
Aggregations