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();
}
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);
}
Aggregations