Examples of RetryNTimes


Examples of org.apache.curator.retry.RetryNTimes

    public void createProtectedNodeInBackgroundTestNoRetry() throws Exception
    {
        final CuratorFramework client =
            CuratorFrameworkFactory.builder()
                .connectString(server.getConnectString())
                .retryPolicy(new RetryNTimes(0, 0))
                .connectionTimeoutMs(100)
                .sessionTimeoutMs(60000)
                .build();
        final CountDownLatch latch = new CountDownLatch(1);
        client.start();
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

        final String PATH = "/foo/bar";

        CuratorFramework        client = null;
        try
        {
            client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryNTimes(0, 0));
            client.start();

            client.create().creatingParentsIfNeeded().forPath(PATH);
            Assert.assertEquals(client.checkExists().forPath(PATH).getNumChildren(), 0);
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

     * Retries 25 times with delay of 200ms
     *
     * @return RetryNTimes
     */
    private static RetryPolicy getRetryPolicy() {
        return new RetryNTimes(25, 200);
    }
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    public void testListenerConnectedAtStart() throws Exception
    {
        server.close();

        Timing timing = new Timing(2);
        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryNTimes(0, 0));
        try
        {
            client.start();

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

Examples of org.apache.curator.retry.RetryNTimes

    {
        final int SLEEP = 1000;
        final int TIMES = 5;

        Timing timing = new Timing();
        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryNTimes(TIMES, SLEEP));
        try
        {
            client.start();
            client.getZookeeperClient().blockUntilConnectedOrTimedOut();
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    private int n = 3;

    @Override
    public RetryPolicy build()
    {
        return new RetryNTimes(n, (int)sleepBetweenRetries.toMillis());
    }
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

        final String PATH = "/foo/bar";

        CuratorFramework        client = null;
        try
        {
            client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryNTimes(0, 0));
            client.start();

            client.create().creatingParentsIfNeeded().forPath(PATH);
            Assert.assertEquals(client.checkExists().forPath(PATH).getNumChildren(), 0);
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    public void flappingTest() throws Exception
    {
        final CuratorFramework client =
            CuratorFrameworkFactory.builder()
                .connectString(server.getConnectString())
                .retryPolicy(new RetryNTimes(1, 500))
                .sessionTimeoutMs(30000)
                .build();

        final TestLeaderSelectorListener listener = new TestLeaderSelectorListener();
        LeaderSelector leaderSelector1 =
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    public void createProtectedNodeInBackgroundTest() throws Exception
    {
        final CuratorFramework client =
            CuratorFrameworkFactory.builder()
                .connectString(server.getConnectString())
                .retryPolicy(new RetryNTimes(2, 1))
                .connectionTimeoutMs(100)
                .sessionTimeoutMs(60000)
                .build();
        final CountDownLatch latch = new CountDownLatch(1);
        client.start();
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    public void createProtectedNodeInBackgroundTestNoRetry() throws Exception
    {
        final CuratorFramework client =
            CuratorFrameworkFactory.builder()
                .connectString(server.getConnectString())
                .retryPolicy(new RetryNTimes(0, 0))
                .connectionTimeoutMs(100)
                .sessionTimeoutMs(60000)
                .build();
        final CountDownLatch latch = new CountDownLatch(1);
        client.start();
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.