Package org.apache.curator.retry

Examples of org.apache.curator.retry.ExponentialBackoffRetry


    }
  }

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


  @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

        throws InterruptedException {
        Validate.notEmpty(connectionString);
        Validate.notEmpty(sampleRateZNode);
        this.sampleRateZNode = sampleRateZNode;

        final RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
        zkCurator = CuratorFrameworkFactory.newClient(connectionString, retryPolicy);
        final ConnectionStateListener initialConnectionState = new InitialConnectionStateListener();
        zkCurator.getConnectionStateListenable().addListener(initialConnectionState);
        zkCurator.start();
View Full Code Here

        private String zookeeperConnectionString;
        private RetryPolicy retryPolicy;

        public CuratorFrameworkProvider(Configuration configuration) {
            zookeeperConnectionString = configuration.get(Configuration.ZK_SERVERS);
            retryPolicy = new ExponentialBackoffRetry(1000, 3);
        }
View Full Code Here

        Map conf = new HashMap();
        conf.put(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT, 1000);
        conf.put(Config.STORM_ZOOKEEPER_CONNECTION_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

    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();
            logDir = new File(System.getProperty("java.io.tmpdir"), "kafka/logs/kafka-test-" + port);
            KafkaConfig config = buildKafkaConfig(zookeeperConnectionString);
View Full Code Here

        TestingCluster cluster = new TestingCluster(2);
        try
        {
            cluster.start();

            client = CuratorFrameworkFactory.builder().connectString(cluster.getConnectString()).canBeReadOnly(true).connectionTimeoutMs(timing.connection()).sessionTimeoutMs(timing.session()).retryPolicy(new ExponentialBackoffRetry(100, 3)).build();
            client.start();

            client.create().forPath("/test");

            final CountDownLatch readOnlyLatch = new CountDownLatch(1);
View Full Code Here

{
    @Test
    public void     testLostSession() throws Exception
    {
        Timing                  timing = new Timing();
        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new ExponentialBackoffRetry(100, 3));
        try
        {
            client.start();

            client.create().forPath("/test-me");
View Full Code Here

    {
        Timing                  timing = new Timing();
        CuratorFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString())
            .sessionTimeoutMs(timing.session())
            .connectionTimeoutMs(timing.connection())
            .retryPolicy(new ExponentialBackoffRetry(100, 3))
            .namespace("aisa")
            .build();
        try
        {
            client.start();
View Full Code Here

    {
        Timing                  timing = new Timing();
        CuratorFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString())
            .sessionTimeoutMs(timing.session())
            .connectionTimeoutMs(timing.connection())
            .retryPolicy(new ExponentialBackoffRetry(100, 3))
            .build();
        try
        {
            client.start();
View Full Code Here

TOP

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

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.