Search in sources :

Example 6 with KafkaChannel

use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.

the class SwitchTrackingService method setup.

@Override
public void setup(FloodlightModuleContext context) {
    producerService = context.getServiceImpl(IKafkaProducerService.class);
    switchManager = context.getServiceImpl(ISwitchManager.class);
    featureDetector = context.getServiceImpl(FeatureDetectorService.class);
    KafkaChannel kafkaChannel = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
    discoveryTopic = kafkaChannel.getTopoDiscoTopic();
    region = kafkaChannel.getRegion();
    context.getServiceImpl(IOFSwitchService.class).addOFSwitchListener(this);
}
Also used : IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) IOFSwitchService(net.floodlightcontroller.core.internal.IOFSwitchService) FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) KafkaChannel(org.openkilda.floodlight.KafkaChannel) KafkaUtilityService(org.openkilda.floodlight.service.kafka.KafkaUtilityService)

Example 7 with KafkaChannel

use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.

the class ZooKeeperService method setup.

@Override
public void setup(FloodlightModuleContext moduleContext) throws FloodlightModuleException {
    KafkaChannel kafkaChannel = moduleContext.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
    region = kafkaChannel.getRegion();
    KildaCore kildaCore = moduleContext.getServiceImpl(KildaCore.class);
    String connectionString = kafkaChannel.getConfig().getZooKeeperConnectString();
    long reconnectDelayMs = kafkaChannel.getConfig().getZooKeeperReconnectDelayMs();
    zkWriter = ZkWriter.builder().id(region).serviceName(ZK_COMPONENT_NAME).connectionString(connectionString).reconnectDelayMs(reconnectDelayMs).expectedState(getExpectedState(kildaCore.getConfig().getRole())).build();
    zooKeeperStateTracker = new ZkStateTracker(zkWriter);
    watchDog = ZkWatchDog.builder().id(region).serviceName(ZK_COMPONENT_NAME).reconnectDelayMs(reconnectDelayMs).connectionString(connectionString).build();
    watchDog.subscribe(this);
    initZookeeper();
}
Also used : ZkStateTracker(org.openkilda.bluegreen.ZkStateTracker) KafkaChannel(org.openkilda.floodlight.KafkaChannel) KafkaUtilityService(org.openkilda.floodlight.service.kafka.KafkaUtilityService) KildaCore(org.openkilda.floodlight.KildaCore)

Example 8 with KafkaChannel

use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.

the class ConnectedDevicesService method setup.

@Override
public void setup(FloodlightModuleContext context) {
    logger.info("Stating {}", ConnectedDevicesService.class.getCanonicalName());
    KafkaChannel kafkaChannel = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
    logger.info("region: {}", kafkaChannel.getRegion());
    region = kafkaChannel.getRegion();
    producerService = context.getServiceImpl(IKafkaProducerService.class);
    topic = kafkaChannel.getConnectedDevicesTopic();
    InputService inputService = context.getServiceImpl(InputService.class);
    inputService.addTranslator(OFType.PACKET_IN, this);
}
Also used : InputService(org.openkilda.floodlight.service.of.InputService) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) KafkaChannel(org.openkilda.floodlight.KafkaChannel) KafkaUtilityService(org.openkilda.floodlight.service.kafka.KafkaUtilityService)

Example 9 with KafkaChannel

use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.

the class NetworkDiscoveryEmitterTest method setUp.

@Before
public void setUp() throws Exception {
    injectMocks(this);
    moduleContext.addService(IKafkaProducerService.class, kafkaProducerService);
    moduleContext.addService(IPathVerificationService.class, pathVerificationService);
    KafkaChannel kafkaChannel = mock(KafkaChannel.class);
    expect(kafkaChannel.getTopoDiscoTopic()).andStubReturn(CONFIRMATION_TOPIC);
    expect(kafkaChannel.getRegion()).andStubReturn(REGION);
    KafkaUtilityService kafkaUtility = mock(KafkaUtilityService.class);
    expect(kafkaUtility.getKafkaChannel()).andStubReturn(kafkaChannel);
    moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
}
Also used : KafkaChannel(org.openkilda.floodlight.KafkaChannel) KafkaUtilityService(org.openkilda.floodlight.service.kafka.KafkaUtilityService) Before(org.junit.Before)

Aggregations

KafkaChannel (org.openkilda.floodlight.KafkaChannel)9 KafkaUtilityService (org.openkilda.floodlight.service.kafka.KafkaUtilityService)8 Before (org.junit.Before)3 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)2 FloodlightModuleConfigurationProvider (org.openkilda.floodlight.config.provider.FloodlightModuleConfigurationProvider)2 IKafkaProducerService (org.openkilda.floodlight.service.kafka.IKafkaProducerService)2 InputService (org.openkilda.floodlight.service.of.InputService)2 IRestApiService (net.floodlightcontroller.restserver.IRestApiService)1 ZkStateTracker (org.openkilda.bluegreen.ZkStateTracker)1 KildaCore (org.openkilda.floodlight.KildaCore)1 KildaCoreConfig (org.openkilda.floodlight.KildaCoreConfig)1 PathVerificationServiceWebRoutable (org.openkilda.floodlight.pathverification.web.PathVerificationServiceWebRoutable)1 FeatureDetectorService (org.openkilda.floodlight.service.FeatureDetectorService)1 PingService (org.openkilda.floodlight.service.ping.PingService)1