use of org.apache.curator.RetryPolicy in project eventuate-tram-core by eventuate-tram.
the class MessageTableChangesToDestinationsConfiguration method makeStartedCuratorClient.
static CuratorFramework makeStartedCuratorClient(String connectionString) {
RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
CuratorFramework client = CuratorFrameworkFactory.builder().retryPolicy(retryPolicy).connectString(connectionString).build();
client.start();
return client;
}
use of org.apache.curator.RetryPolicy in project druid by druid-io.
the class CuratorModule method makeEnsembleProvider.
@Provides
@LazySingleton
public EnsembleProvider makeEnsembleProvider(CuratorConfig config, ExhibitorConfig exConfig) {
if (exConfig.getHosts().isEmpty()) {
return new FixedEnsembleProvider(config.getZkHosts());
}
RetryPolicy retryPolicy = new BoundedExponentialBackoffRetry(BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES);
return new ExhibitorEnsembleProvider(new Exhibitors(exConfig.getHosts(), exConfig.getRestPort(), newBackupProvider(config.getZkHosts())), new DefaultExhibitorRestClient(exConfig.getUseSsl()), exConfig.getRestUriPath(), exConfig.getPollingMs(), retryPolicy) {
@Override
public void start() throws Exception {
log.debug("Polling the list of ZooKeeper servers for the initial ensemble");
this.pollForInitialEnsemble();
super.start();
}
};
}
use of org.apache.curator.RetryPolicy in project drill by apache.
the class TestZookeeperClient method setUp.
@Before
public void setUp() throws Exception {
ZookeeperTestUtil.setZookeeperSaslTestConfigProps();
server = new TestingServer();
final RetryPolicy policy = new RetryNTimes(1, 1000);
curator = CuratorFrameworkFactory.newClient(server.getConnectString(), policy);
client = new ClientWithMockCache(curator, root, mode);
server.start();
curator.start();
client.start();
}
use of org.apache.curator.RetryPolicy in project turbo-rpc by hank-whu.
the class ZooKeeperDiscover method init.
@Override
public void init(List<HostPort> hostPorts) {
watchers = new ConcurrentArrayList<>();
String connectString = hostPorts.stream().map(i -> i.toString()).collect(Collectors.joining(","));
RetryPolicy retryPolicy = new ForeverRetryPolicy(1000, 60 * 1000);
client = CuratorFrameworkFactory.newClient(connectString, 1000 * 10, 1000 * 3, retryPolicy);
client.start();
}
Aggregations