use of org.openkilda.messaging.floodlight.response.PingResponse in project open-kilda by telstra.
the class PingRouter method routePingResponse.
private void routePingResponse(Tuple input) throws PipelineException {
PingResponse response = pullPingResponse(input);
Values output = new Values(response.getPingId(), response, pullContext(input));
getOutput().emit(STREAM_RESPONSE_ID, input, output);
}
use of org.openkilda.messaging.floodlight.response.PingResponse 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.messaging.floodlight.response.PingResponse in project open-kilda by telstra.
the class PingCommand method sendErrorResponse.
void sendErrorResponse(UUID pingId, Ping.Errors errorCode) {
PingResponse response = new PingResponse(pingId, errorCode);
sendResponse(response);
}
use of org.openkilda.messaging.floodlight.response.PingResponse in project open-kilda by telstra.
the class PingResponseCommand method process.
private void process(PingData data) {
Long latency = input.getLatency();
if (latency == null) {
log.warn("There is no latency info for {} - ping latency is unreliable", data.getPingId());
latency = 0L;
}
PingMeters meters = data.produceMeasurements(input.getReceiveTime(), latency);
logCatch(data, meters);
PingResponse response = new PingResponse(getContext().getCtime(), data.getPingId(), meters);
sendResponse(response);
}
use of org.openkilda.messaging.floodlight.response.PingResponse in project open-kilda by telstra.
the class PingRequestCommandAbstractTest method verifySentErrorResponse.
protected void verifySentErrorResponse(Ping ping, Ping.Errors errorCode) {
List<Message> replies = kafkaMessageCatcher.getValues();
Assert.assertEquals(1, replies.size());
InfoMessage message = (InfoMessage) replies.get(0);
PingResponse response = (PingResponse) message.getData();
Assert.assertEquals(ping.getPingId(), response.getPingId());
Assert.assertEquals(errorCode, response.getError());
}
Aggregations