use of org.apache.curator.test.Timing in project druid by druid-io.
the class OverlordTest method setupServerAndCurator.
private 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.test.Timing in project druid by druid-io.
the class BatchServerInventoryViewTest method waitForSync.
private static void waitForSync(BatchServerInventoryView batchServerInventoryView, Set<DataSegment> testSegments) throws Exception {
final Timing forWaitingTiming = timing.forWaiting();
Stopwatch stopwatch = Stopwatch.createStarted();
while (Iterables.isEmpty(batchServerInventoryView.getInventory()) || Iterables.get(batchServerInventoryView.getInventory(), 0).getSegments().size() != testSegments.size()) {
Thread.sleep(100);
if (stopwatch.elapsed(TimeUnit.MILLISECONDS) > forWaitingTiming.milliseconds()) {
throw new ISE("BatchServerInventoryView is not updating");
}
}
}
use of org.apache.curator.test.Timing 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.test.Timing 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.test.Timing 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();
}
Aggregations