Search in sources :

Example 46 with FlowRerouteRequest

use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.

the class ActionBolt method sendFlowRerouteRequest.

@Override
public void sendFlowRerouteRequest(String flowId) {
    FlowRerouteRequest request = new FlowRerouteRequest(flowId, false, false, false, Collections.emptySet(), "Flow latency become unhealthy", false);
    emit(getCurrentTuple(), new Values(request, getCommandContext()));
}
Also used : Values(org.apache.storm.tuple.Values) FlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest)

Example 47 with FlowRerouteRequest

use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.

the class ActionBolt method sendFlowSyncRequest.

@Override
public void sendFlowSyncRequest(String flowId) {
    FlowRerouteRequest request = new FlowRerouteRequest(flowId, true, false, false, Collections.emptySet(), "Flow latency become healthy", false);
    emit(getCurrentTuple(), new Values(request, getCommandContext()));
}
Also used : Values(org.apache.storm.tuple.Values) FlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest)

Example 48 with FlowRerouteRequest

use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.

the class FlowServiceImpl method reroute.

private CompletableFuture<FlowReroutePayload> reroute(String flowId, boolean forced) {
    logger.debug("Reroute flow: {}={}, forced={}", FLOW_ID, flowId, forced);
    String correlationId = RequestCorrelationId.getId();
    FlowRerouteRequest payload = createManualFlowRerouteRequest(flowId, forced, false, "initiated via Northbound");
    CommandMessage command = new CommandMessage(payload, System.currentTimeMillis(), correlationId, Destination.WFM);
    return messagingChannel.sendAndGet(rerouteTopic, command).thenApply(FlowRerouteResponse.class::cast).thenApply(response -> flowMapper.toReroutePayload(flowId, response.getPayload(), response.isRerouted()));
}
Also used : FlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest) FlowRerouteRequest.createManualFlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest.createManualFlowRerouteRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Example 49 with FlowRerouteRequest

use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.

the class FlowServiceImpl method rerouteFlowV2.

@Override
public CompletableFuture<FlowRerouteResponseV2> rerouteFlowV2(String flowId) {
    logger.info("Processing flow reroute: {}", flowId);
    FlowRerouteRequest payload = createManualFlowRerouteRequest(flowId, false, false, "initiated via Northbound");
    CommandMessage command = new CommandMessage(payload, System.currentTimeMillis(), RequestCorrelationId.getId(), Destination.WFM);
    return messagingChannel.sendAndGet(rerouteTopic, command).thenApply(FlowRerouteResponse.class::cast).thenApply(response -> flowMapper.toRerouteResponseV2(flowId, response.getPayload(), response.isRerouted()));
}
Also used : FlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest) FlowRerouteRequest.createManualFlowRerouteRequest(org.openkilda.messaging.command.flow.FlowRerouteRequest.createManualFlowRerouteRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

FlowRerouteRequest (org.openkilda.messaging.command.flow.FlowRerouteRequest)49 Test (org.junit.Test)27 Flow (org.openkilda.model.Flow)23 FlowSegmentRequest (org.openkilda.floodlight.api.request.FlowSegmentRequest)14 Values (org.apache.storm.tuple.Values)10 YFlowRerouteRequest (org.openkilda.messaging.command.yflow.YFlowRerouteRequest)9 CommandMessage (org.openkilda.messaging.command.CommandMessage)8 IslEndpoint (org.openkilda.model.IslEndpoint)8 CommandContext (org.openkilda.wfm.CommandContext)7 FlowPath (org.openkilda.model.FlowPath)6 FlowThrottlingData (org.openkilda.wfm.topology.reroute.model.FlowThrottlingData)5 RerouteResultInfoData (org.openkilda.messaging.info.reroute.RerouteResultInfoData)4 GetPathsResult (org.openkilda.pce.GetPathsResult)4 FlowPathRepository (org.openkilda.persistence.repositories.FlowPathRepository)4 HashSet (java.util.HashSet)3 RerouteQueue (org.openkilda.wfm.topology.reroute.model.RerouteQueue)3 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 Ignore (org.junit.Ignore)2 FlowErrorResponse (org.openkilda.floodlight.flow.response.FlowErrorResponse)2