Search in sources :

Example 1 with FlowHistoryPayload

use of org.openkilda.messaging.payload.history.FlowHistoryPayload in project open-kilda by telstra.

the class HistoryOperationsBolt method getFlowHistory.

@TimedExecution("get_flow_history")
private List<InfoData> getFlowHistory(GetFlowHistoryRequest request) {
    Instant timeFrom = Instant.ofEpochSecond(request.getTimestampFrom());
    Instant timeTo = Instant.ofEpochSecond(request.getTimestampTo() + 1).minusMillis(1);
    return historyService.listFlowEvents(request.getFlowId(), timeFrom, timeTo, request.getMaxCount()).stream().map(entry -> {
        List<FlowHistoryPayload> payload = listFlowHistories(entry);
        List<FlowDumpPayload> dumps = listFlowDumps(entry);
        return HistoryMapper.INSTANCE.map(entry, payload, dumps);
    }).collect(Collectors.toList());
}
Also used : BaseRequest(org.openkilda.messaging.nbtopology.request.BaseRequest) FlowDumpPayload(org.openkilda.messaging.payload.history.FlowDumpPayload) FlowEvent(org.openkilda.model.history.FlowEvent) GetFlowStatusTimestampsRequest(org.openkilda.messaging.nbtopology.request.GetFlowStatusTimestampsRequest) PortHistoryRequest(org.openkilda.messaging.nbtopology.request.PortHistoryRequest) HistoryMapper(org.openkilda.wfm.share.mappers.HistoryMapper) InfoData(org.openkilda.messaging.info.InfoData) StreamType(org.openkilda.wfm.topology.nbworker.StreamType) Instant(java.time.Instant) HistoryService(org.openkilda.wfm.share.history.service.HistoryService) Collectors(java.util.stream.Collectors) List(java.util.List) Tuple(org.apache.storm.tuple.Tuple) FlowHistoryPayload(org.openkilda.messaging.payload.history.FlowHistoryPayload) TimedExecution(org.openkilda.wfm.share.metrics.TimedExecution) GetFlowHistoryRequest(org.openkilda.messaging.nbtopology.request.GetFlowHistoryRequest) PersistenceManager(org.openkilda.persistence.PersistenceManager) Instant(java.time.Instant) List(java.util.List) TimedExecution(org.openkilda.wfm.share.metrics.TimedExecution)

Aggregations

Instant (java.time.Instant)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Tuple (org.apache.storm.tuple.Tuple)1 InfoData (org.openkilda.messaging.info.InfoData)1 BaseRequest (org.openkilda.messaging.nbtopology.request.BaseRequest)1 GetFlowHistoryRequest (org.openkilda.messaging.nbtopology.request.GetFlowHistoryRequest)1 GetFlowStatusTimestampsRequest (org.openkilda.messaging.nbtopology.request.GetFlowStatusTimestampsRequest)1 PortHistoryRequest (org.openkilda.messaging.nbtopology.request.PortHistoryRequest)1 FlowDumpPayload (org.openkilda.messaging.payload.history.FlowDumpPayload)1 FlowHistoryPayload (org.openkilda.messaging.payload.history.FlowHistoryPayload)1 FlowEvent (org.openkilda.model.history.FlowEvent)1 PersistenceManager (org.openkilda.persistence.PersistenceManager)1 HistoryService (org.openkilda.wfm.share.history.service.HistoryService)1 HistoryMapper (org.openkilda.wfm.share.mappers.HistoryMapper)1 TimedExecution (org.openkilda.wfm.share.metrics.TimedExecution)1 StreamType (org.openkilda.wfm.topology.nbworker.StreamType)1