Examples of BoundedExponentialBackoffRetry


Examples of com.netflix.curator.retry.BoundedExponentialBackoffRetry

    public String getNamespace() {
        return _namespace;
    }

    public RetryPolicy getRetry() {
        return new BoundedExponentialBackoffRetry(_retry.baseSleepTimeMs, _retry.maxSleepTimeMs, _retry.maxAttempts);
    }
View Full Code Here

Examples of com.netflix.curator.retry.BoundedExponentialBackoffRetry

    public String getNamespace() {
        return _namespace;
    }

    public RetryPolicy getRetry() {
        return new BoundedExponentialBackoffRetry(_retry.baseSleepTimeMs, _retry.maxSleepTimeMs, _retry.maxAttempts);
    }
View Full Code Here

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

Examples of org.apache.curator.retry.BoundedExponentialBackoffRetry

          {
            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

Examples of org.apache.curator.retry.BoundedExponentialBackoffRetry

  {
    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

Examples of org.apache.curator.retry.BoundedExponentialBackoffRetry

    private int maxRetries = 3;

    @Override
    public RetryPolicy build()
    {
        return new BoundedExponentialBackoffRetry((int)baseSleepTime.toMillis(), (int)maxSleepTime.toMillis(), maxRetries);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.