use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class KafkaMessageCollector method startUp.
@Override
public void startUp(FloodlightModuleContext moduleContext) {
logger.info("Starting {}", this.getClass().getCanonicalName());
FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(moduleContext, this);
KafkaMessageCollectorConfig consumerConfig = provider.getConfiguration(KafkaMessageCollectorConfig.class);
KafkaChannel kafkaChannel = moduleContext.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
logger.info("region: {}", kafkaChannel.getRegion());
ConsumerLauncher launcher = new ConsumerLauncher(moduleContext, consumerConfig);
launchTopics(consumerConfig, kafkaChannel, launcher);
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class PathVerificationService method startUp.
@Override
public void startUp(FloodlightModuleContext context) throws FloodlightModuleException {
logger.info("Stating {}", PathVerificationService.class.getCanonicalName());
KafkaChannel kafkaChannel = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
logger.info("region: {}", kafkaChannel.getRegion());
topoDiscoTopic = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel().getTopoDiscoTopic();
islLatencyTopic = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel().getIslLatencyTopic();
region = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel().getRegion();
InputService inputService = context.getServiceImpl(InputService.class);
inputService.addTranslator(OFType.PACKET_IN, this);
context.getServiceImpl(PingService.class).setup(context);
context.getServiceImpl(IRestApiService.class).addRestletRoutable(new PathVerificationServiceWebRoutable());
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class OfBatchExecutor method sendResponse.
private void sendResponse() {
KafkaChannel kafkaChannel = kafkaUtilityService.getKafkaChannel();
log.debug("Send response to {} (key={})", kafkaChannel.getSpeakerFlowHsTopic(), kafkaKey);
kafkaProducerService.sendMessageAndTrack(kafkaChannel.getSpeakerFlowHsTopic(), kafkaKey, holder.getResult());
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class PingCommandTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(moduleContext, KildaCore.class);
KildaCoreConfig coreConfig = provider.getConfiguration(KildaCoreConfig.class);
expect(kildaCore.getConfig()).andStubReturn(coreConfig);
moduleContext.addService(KildaCore.class, kildaCore);
moduleContext.addService(IKafkaProducerService.class, producerService);
moduleContext.addService(PingService.class, pingService);
KafkaChannel topics = createMock(KafkaChannel.class);
expect(topics.getPingTopic()).andReturn(PING_KAFKA_TOPIC).anyTimes();
KafkaUtilityService kafkaUtility = createMock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andReturn(topics).anyTimes();
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
producerService.sendMessageAndTrack(anyString(), capture(kafkaMessageCatcher));
expectLastCall().andVoid().anyTimes();
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class SwitchTrackingServiceTest method setUp.
@Before
public void setUp() throws Exception {
injectMocks(this);
moduleContext.addService(ISwitchManager.class, switchManager);
moduleContext.addService(FeatureDetectorService.class, featureDetector);
moduleContext.addService(IKafkaProducerService.class, producerService);
IOFSwitchService iofSwitchService = createMock(IOFSwitchService.class);
iofSwitchService.addOFSwitchListener(eq(service));
moduleContext.addService(IOFSwitchService.class, iofSwitchService);
KafkaChannel topics = createMock(KafkaChannel.class);
expect(topics.getTopoDiscoTopic()).andReturn(KAFKA_ISL_DISCOVERY_TOPIC);
expect(topics.getRegion()).andReturn("1");
KafkaUtilityService kafkaUtility = createMock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andReturn(topics);
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
replay(kafkaUtility, topics, iofSwitchService);
service.setup(moduleContext);
verify(iofSwitchService);
reset(kafkaUtility, topics, iofSwitchService);
}
Aggregations