Search in sources :

Example 1 with PingResponse

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);
}
Also used : Values(org.apache.storm.tuple.Values) PingResponse(org.openkilda.messaging.floodlight.response.PingResponse)

Example 2 with PingResponse

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);
    }
}
Also used : TimeoutDescriptor(org.openkilda.wfm.topology.ping.model.TimeoutDescriptor) PingResponse(org.openkilda.messaging.floodlight.response.PingResponse)

Example 3 with PingResponse

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);
}
Also used : PingResponse(org.openkilda.messaging.floodlight.response.PingResponse)

Example 4 with PingResponse

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);
}
Also used : PingResponse(org.openkilda.messaging.floodlight.response.PingResponse) PingMeters(org.openkilda.messaging.model.PingMeters)

Example 5 with PingResponse

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());
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) InfoMessage(org.openkilda.messaging.info.InfoMessage) PingResponse(org.openkilda.messaging.floodlight.response.PingResponse)

Aggregations

PingResponse (org.openkilda.messaging.floodlight.response.PingResponse)6 Message (org.openkilda.messaging.Message)2 InfoMessage (org.openkilda.messaging.info.InfoMessage)2 FloodlightContext (net.floodlightcontroller.core.FloodlightContext)1 Ethernet (net.floodlightcontroller.packet.Ethernet)1 IPacket (net.floodlightcontroller.packet.IPacket)1 Values (org.apache.storm.tuple.Values)1 Test (org.junit.Test)1 OfInput (org.openkilda.floodlight.model.OfInput)1 PingData (org.openkilda.floodlight.model.PingData)1 PathVerificationService (org.openkilda.floodlight.pathverification.PathVerificationService)1 InputService (org.openkilda.floodlight.service.of.InputService)1 PingService (org.openkilda.floodlight.service.ping.PingService)1 ISwitchManager (org.openkilda.floodlight.switchmanager.ISwitchManager)1 SwitchManager (org.openkilda.floodlight.switchmanager.SwitchManager)1 NetworkEndpoint (org.openkilda.messaging.model.NetworkEndpoint)1 Ping (org.openkilda.messaging.model.Ping)1 PingMeters (org.openkilda.messaging.model.PingMeters)1 FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)1 SwitchId (org.openkilda.model.SwitchId)1