Search in sources :

Example 1 with IslBaseLatency

use of org.openkilda.messaging.info.event.IslBaseLatency in project open-kilda by telstra.

the class IslDataSplitterBolt method handleInput.

@Override
protected void handleInput(Tuple input) throws PipelineException {
    Message message = pullValue(input, FIELD_ID_PAYLOAD, Message.class);
    InfoData infoData;
    if (message instanceof InfoMessage) {
        infoData = ((InfoMessage) message).getData();
    } else {
        unhandledInput(input);
        return;
    }
    if (infoData instanceof IslChangedInfoData) {
        IslChangedInfoData data = (IslChangedInfoData) infoData;
        emitWithContext(ISL_UPDATE_STREAM_ID.name(), input, new Values(getIslKey(data.getSource().getDatapath(), data.getSource().getPortNumber()), data));
        emitWithContext(ISL_UPDATE_STREAM_ID.name(), input, new Values(getIslKey(data.getDestination().getDatapath(), data.getDestination().getPortNumber()), revert(data)));
    } else if (infoData instanceof IslBaseLatency) {
        IslBaseLatency islBaseLatency = (IslBaseLatency) infoData;
        emit(input, new Values(getIslKey(islBaseLatency.getSrcSwitchId(), islBaseLatency.getSrcPortNo()), infoData, getCommandContext()));
    } else {
        unhandledInput(input);
    }
}
Also used : IslChangedInfoData(org.openkilda.messaging.info.event.IslChangedInfoData) InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) InfoData(org.openkilda.messaging.info.InfoData) IslChangedInfoData(org.openkilda.messaging.info.event.IslChangedInfoData) InfoMessage(org.openkilda.messaging.info.InfoMessage) IslBaseLatency(org.openkilda.messaging.info.event.IslBaseLatency) Values(org.apache.storm.tuple.Values)

Aggregations

Values (org.apache.storm.tuple.Values)1 Message (org.openkilda.messaging.Message)1 InfoData (org.openkilda.messaging.info.InfoData)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 IslBaseLatency (org.openkilda.messaging.info.event.IslBaseLatency)1 IslChangedInfoData (org.openkilda.messaging.info.event.IslChangedInfoData)1