Examples of ExponentialBackoffRetry


Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        while (++i > 0) {
            try {
                final int a = _random.nextInt(10);
                final int b = 1 + _random.nextInt(9);
                final int op = _random.nextInt(4);
                int result = _calculatorPool.execute(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS),
                        new ServiceCallback<CalculatorService, Integer>() {
                            @Override
                            public Integer call(CalculatorService service) throws ServiceException {
                                return CalculatorUser.this.call(service, op, a, b);
                            }
View Full Code Here

Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        CalculatorServiceFactory serviceFactory = new CalculatorServiceFactory(config.getHttpClientConfiguration());
        CalculatorService service = ServicePoolBuilder.create(CalculatorService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));

        // If using Yammer Metrics or running in Dropwizard (which includes Yammer Metrics), you may want a health
        // check that pings a service you depend on. This will register a simple check that will confirm the service
        // pool contains at least one healthy end point.
        HealthChecks.register(new ContainsHealthyEndPointCheck(ServicePoolProxies.getPool(service), "calculator-user"));
View Full Code Here

Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        CalculatorService service = ServicePoolBuilder.create(CalculatorService.class)
                .withServiceFactory(new CalculatorServiceFactory(configuration.getHttpClientConfiguration()))
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, "calculator"))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));

        // If using Yammer Metrics or running in Dropwizard (which includes Yammer Metrics), you may want a health
        // check that pings a service you depend on. This will register a simple check that will confirm the service
        // pool contains at least one healthy end point.
        HealthChecks.register(new ContainsHealthyEndPointCheck(ServicePoolProxies.getPool(service), "calculator-user"));
View Full Code Here

Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        while (++i > 0) {
            try {
                final int a = _random.nextInt(10);
                final int b = 1 + _random.nextInt(9);
                final int op = _random.nextInt(4);
                int result = _calculatorPool.execute(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS),
                        new ServiceCallback<CalculatorService, Integer>() {
                            @Override
                            public Integer call(CalculatorService service) throws ServiceException {
                                return CalculatorUser.this.call(service, op, a, b);
                            }
View Full Code Here

Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));

        // If using Yammer Metrics or running in Dropwizard (which includes Yammer Metrics), you may want a health
        // check that pings a service you depend on. This will register a simple check that will confirm the service
        // pool contains at least one healthy end point.
        HealthChecks.register(ContainsHealthyEndPointCheck.forProxy(service, "dictionary-user"));
View Full Code Here

Examples of com.bazaarvoice.ostrich.retry.ExponentialBackoffRetry

        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));

        // If using Yammer Metrics or running in Dropwizard (which includes Yammer Metrics), you may want a health
        // check that pings a service you depend on. This will register a simple check that will confirm the service
        // pool contains at least one healthy end point.
        HealthChecks.register(new ContainsHealthyEndPointCheck(ServicePoolProxies.getPool(service), "dictionary-user"));
View Full Code Here

Examples of com.netflix.curator.retry.ExponentialBackoffRetry

        String connectionString = server.getConnectString();
        Map conf = new HashMap();
        conf.put(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT, 1000);
        conf.put(Config.STORM_ZOOKEEPER_RETRY_TIMES, 4);
        conf.put(Config.STORM_ZOOKEEPER_RETRY_INTERVAL, 5);
        ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
        zookeeper = CuratorFrameworkFactory.newClient(connectionString, retryPolicy);
        dynamicBrokersReader = new DynamicBrokersReader(conf, connectionString, masterPath, topic);
        zookeeper.start();
    }
View Full Code Here

Examples of com.netflix.curator.retry.ExponentialBackoffRetry

    public KafkaTestBroker() {
        try {
            server = new TestingServer();
            String zookeeperConnectionString = server.getConnectString();
            ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
            zookeeper = CuratorFrameworkFactory.newClient(zookeeperConnectionString, retryPolicy);
            zookeeper.start();
            port = InstanceSpec.getRandomPort();
            kafka.server.KafkaConfig config = buildKafkaConfig(zookeeperConnectionString);
            kafka = new KafkaServerStartable(config);
View Full Code Here

Examples of org.apache.curator.retry.ExponentialBackoffRetry

    }
  }

  protected CuratorFramework createClient() {
    return CuratorFrameworkFactory.newClient(zkConnString,
        new ExponentialBackoffRetry(1000, 1));
  }
View Full Code Here

Examples of org.apache.curator.retry.ExponentialBackoffRetry

  @Before
  public void setUp() throws Exception {
    zkServer = new TestingServer();
    client = CuratorFrameworkFactory
        .newClient("localhost:" + zkServer.getPort(),
            new ExponentialBackoffRetry(1000, 3));
    client.start();

    EnsurePath ensurePath = new EnsurePath(AGENT_PATH);
    ensurePath.ensure(client.getZookeeperClient());
    doSetUp();
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.