use of org.openkilda.bluegreen.LifecycleEvent in project open-kilda by telstra.
the class ZooKeeperSpout method nextTuple.
@Override
public void nextTuple() {
Signal signal = signals.poll();
if (signal != null) {
LifecycleEvent event = LifecycleEvent.builder().signal(signal).uuid(UUID.randomUUID()).messageId(messageId++).build();
log.info("Component {} with id {} received signal {} from zookeeper. Sending event {}", serviceName, id, signal, event);
collector.emit(new Values(event, new CommandContext()), messageId);
} else {
org.apache.storm.utils.Utils.sleep(1L);
}
if (!watchDog.isConnectedAndValidated()) {
if (isZooKeeperConnectTimeoutPassed()) {
log.info("Service {} with run_id {} tries to reconnect to ZooKeeper {}", serviceName, id, connectionString);
watchDog.safeRefreshConnection();
zooKeeperConnectionTimestamp = Instant.now();
}
}
}
Aggregations