Package com.netflix.astyanax.retry

Examples of com.netflix.astyanax.retry.RunOnce


       
        cp.setHosts(ring1);
       
        BigInteger threeNodeRingIncrement = TokenGenerator.MAXIMUM.divide(new BigInteger("3"));

        RetryPolicy retryPolicy = new RunOnce();

        BigInteger key = BigInteger.ZERO;
        LOG.info(key.toString() + " 127.0.1.2");
        OperationResult<String> result = cp.executeWithFailover(new TokenTestOperation(key), retryPolicy);
        assertNotNull(result);
View Full Code Here


        LOG.info(BigIntegerSerializer.get().fromByteBuffer(firstHostOp.getRowKey()).toString());
        LOG.info(BigIntegerSerializer.get().fromByteBuffer(secondHostOp.getRowKey()).toString());
        LOG.info(BigIntegerSerializer.get().fromByteBuffer(thirdHostOp.getRowKey()).toString());
        LOG.info(BigIntegerSerializer.get().fromByteBuffer(maxTokenHostOp.getRowKey()).toString());
        RetryPolicy retryPolicy = new RunOnce();

        OperationResult<String> result = cp.executeWithFailover(firstHostOp, retryPolicy);
        assertNotNull(result);
        assertEquals("127.0.1.2",result.getHost().getIpAddress());
View Full Code Here

        cp.setHosts(ring1);
        LOG.info("testTokenToHostMappingInWrappedRange\n" + TestTokenRange.getRingDetails(ring1));

        Operation<TestClient, String> op = new TokenTestOperation(BigInteger.ZERO);

        RetryPolicy retryPolicy = new RunOnce();

        OperationResult<String> result = cp.executeWithFailover(op, retryPolicy);
        assertNotNull(result);

        // since token ownership wraps node2 should own token 0
View Full Code Here

        cp.setHosts(ring1);
        LOG.info("testTokenToHostMappingOutsideOfRing\n" + TestTokenRange.getRingDetails(ring1));

        Operation<TestClient, String> op = new TokenTestOperation(new BigInteger("1250"));

        RetryPolicy retryPolicy = new RunOnce();

        OperationResult<String> result = cp.executeWithFailover(op, retryPolicy);
        assertNotNull(result);

        // requests for tokens outside the ring will be serviced by host associated with
View Full Code Here

                                    if (e.getCause() instanceof ConnectionException)
                                        throw (ConnectionException)e.getCause();
                                    throw e;
                                }
                            }
                        }, new RunOnce());
                    } catch (PoolTimeoutException e) {
                        LOG.info(e.getMessage());
                    } catch (ConnectionException e) {
                    } finally {
                        sampler.addSample((System.nanoTime() - startTime)/1000000);
View Full Code Here

    @Test
    public void testRetryEmptyPool() {
        ConnectionPool<TestClient> pool = createPool();

        RetryPolicy retry = new RunOnce();
        try {
            pool.executeWithFailover(dummyOperation, retry);
            Assert.fail();
        } catch (ConnectionException e) {
            Assert.assertEquals(1, retry.getAttemptCount());
            LOG.error(e);
        }

        retry = new ConstantBackoff(1, 10);
        try {
            pool.executeWithFailover(dummyOperation, retry);
            Assert.fail();
        } catch (ConnectionException e) {
            Assert.assertEquals(10, retry.getAttemptCount());
            LOG.info(e);
        }
    }
View Full Code Here

    public ObjectReader(ChunkedStorageProvider provider, String objectName, OutputStream os) {
        this.provider = provider;
        this.objectName = objectName;
        this.os = os;
        this.retryPolicy = new RunOnce();
    }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.retry.RunOnce

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.