use of org.apache.curator.retry.RetryOneTime in project druid by druid-io.
the class CuratorTestBase method setupServerAndCurator.
protected void setupServerAndCurator() throws Exception {
server = new TestingServer();
timing = new Timing();
curator = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).sessionTimeoutMs(timing.session()).connectionTimeoutMs(timing.connection()).retryPolicy(new RetryOneTime(1)).compressionProvider(new PotentiallyGzippedCompressionProvider(true)).build();
}
use of org.apache.curator.retry.RetryOneTime in project zipkin by openzipkin.
the class ZooKeeperRule method doEvaluate.
void doEvaluate(Statement base) throws Throwable {
try {
cluster = new TestingCluster(3);
cluster.start();
client = newClient(cluster.getConnectString(), new RetryOneTime(200));
client.start();
checkState(client.blockUntilConnected(5, TimeUnit.SECONDS), "failed to connect to zookeeper in 5 seconds");
base.evaluate();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted while connecting to ZooKeeper", e);
} finally {
client.close();
cluster.close();
}
}
use of org.apache.curator.retry.RetryOneTime in project curator by Netflix.
the class ZkTestSystem method createZkConnection.
public static IZkConnection createZkConnection(String connectString) {
Timing timing = new Timing();
CuratorFramework client = CuratorFrameworkFactory.newClient(connectString, timing.session(), timing.connection(), new RetryOneTime(1));
client.start();
try {
return new CuratorZKClientBridge(client);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.apache.curator.retry.RetryOneTime in project exhibitor by soabase.
the class TestZookeeperConfigProvider method setup.
@BeforeMethod
public void setup() throws Exception {
timing = new Timing();
cluster = new TestingCluster(3);
cluster.start();
client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
client.start();
}
use of org.apache.curator.retry.RetryOneTime in project chassis by Kixeye.
the class ConfigurationBuilderTest method initializeZookeeper.
private static void initializeZookeeper() throws Exception {
zookeeperServer = new TestingServer();
curatorFramework = CuratorFrameworkFactory.newClient(zookeeperServer.getConnectString(), new RetryOneTime(1000));
curatorFramework.start();
}
Aggregations