Package org.apache.curator.retry

Examples of org.apache.curator.retry.BoundedExponentialBackoffRetry


        LOGGER.debug("user session counter for %s is now %d", userId, count);
        return count;
    }

    private int adjustAndGet(String userId, Direction direction) {
        RetryPolicy retryPolicy = new BoundedExponentialBackoffRetry(BASE_SLEEP_TIME_MS, MAX_SLEEP_TIME_MS, MAX_RETRIES);
        DistributedAtomicInteger distributedAtomicInteger = new DistributedAtomicInteger(curatorFramework, counterPath(userId), retryPolicy);

        try {
            distributedAtomicInteger.initialize(0); // this will respect an existing value but set uninitialized values to 0
        } catch (Exception e) {
View Full Code Here


          {
            final CuratorFramework framework =
                CuratorFrameworkFactory.builder()
                                       .connectString(bridgeCuratorConfig.getParentZkHosts())
                                       .sessionTimeoutMs(bridgeCuratorConfig.getZkSessionTimeoutMs())
                                       .retryPolicy(new BoundedExponentialBackoffRetry(1000, 45000, 30))
                                       .compressionProvider(
                                           new PotentiallyGzippedCompressionProvider(
                                               bridgeCuratorConfig.enableCompression()
                                           )
                                       )
View Full Code Here

  {
    final CuratorFramework framework =
        CuratorFrameworkFactory.builder()
                               .connectString(config.getZkHosts())
                               .sessionTimeoutMs(config.getZkSessionTimeoutMs())
            .retryPolicy(new BoundedExponentialBackoffRetry(1000, 45000, 30))
            .compressionProvider(new PotentiallyGzippedCompressionProvider(config.enableCompression()))
            .build();

    lifecycle.addHandler(
        new Lifecycle.Handler()
View Full Code Here

    private int maxRetries = 3;

    @Override
    public RetryPolicy build()
    {
        return new BoundedExponentialBackoffRetry((int)baseSleepTime.toMillis(), (int)maxSleepTime.toMillis(), maxRetries);
    }
View Full Code Here

TOP

Related Classes of org.apache.curator.retry.BoundedExponentialBackoffRetry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.