use of org.apache.curator.RetryPolicy in project metron by apache.
the class FluxTopologyComponent method start.
@Override
public void start() throws UnableToStartException {
try {
stormCluster = new LocalCluster();
RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
try (CuratorFramework client = CuratorFrameworkFactory.newClient(getZookeeperConnectString(), retryPolicy)) {
client.start();
String root = "/storm/leader-lock";
Stat exists = client.checkExists().forPath(root);
if (exists == null) {
client.create().creatingParentsIfNeeded().forPath(root);
}
} catch (Exception e) {
LOG.error("Unable to create leaderlock", e);
} finally {
}
} catch (Exception e) {
throw new UnableToStartException("Unable to start flux topology: " + getTopologyLocation(), e);
}
}
Aggregations