Search in sources :

Example 1 with ZkStateTracker

use of org.openkilda.bluegreen.ZkStateTracker 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 2 with ZkStateTracker

use of org.openkilda.bluegreen.ZkStateTracker in project open-kilda by telstra.

the class ZooKeeperBolt method initZk.

private void initZk() {
    zkWriter = ZkWriter.builder().id(id).serviceName(serviceName).connectionRefreshInterval(ZkClient.DEFAULT_CONNECTION_REFRESH_INTERVAL).connectionString(connectionString).reconnectDelayMs(reconnectDelayMs).expectedState(expectedState).build();
    zkWriter.initAndWaitConnection();
    zkStateTracker = new ZkStateTracker(zkWriter);
}
Also used : ZkStateTracker(org.openkilda.bluegreen.ZkStateTracker)

Aggregations

ZkStateTracker (org.openkilda.bluegreen.ZkStateTracker)2 KafkaChannel (org.openkilda.floodlight.KafkaChannel)1 KildaCore (org.openkilda.floodlight.KildaCore)1 KafkaUtilityService (org.openkilda.floodlight.service.kafka.KafkaUtilityService)1