Package com.netflix.astyanax.connectionpool.impl

Examples of com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl


        if (context == null) {
            context = new AstyanaxContext.Builder()
               .forCluster(getClusterName())
               .forKeyspace(getKeyspaceName())   
               .withConnectionPoolConfiguration(
                   new ConnectionPoolConfigurationImpl(getConnectionPoolName())
                   .setPort(getPort())
                   .setMaxConnsPerHost(getConnectionsPerHost())
                   .setSeeds(getSeeds()))
               .withConnectionPoolMonitor(new Slf4jConnectionPoolMonitorImpl())
               .withAstyanaxConfiguration(
View Full Code Here


import com.netflix.astyanax.connectionpool.impl.SimpleRateLimiterImpl;

public class RateLimiterTest {
    @Test
    public void testRateLimiter() {
        ConnectionPoolConfigurationImpl config = new ConnectionPoolConfigurationImpl(
                "cluster_keyspace");
        config.setConnectionLimiterMaxPendingCount(10);
        config.setConnectionLimiterWindowSize(1000);

        SimpleRateLimiterImpl limit = new SimpleRateLimiterImpl(config);

        int time = 0;
        boolean result;
View Full Code Here

        Assert.assertTrue(result);
    }

    @Test
    public void testRateLimiter2() {
        ConnectionPoolConfigurationImpl config = new ConnectionPoolConfigurationImpl(
                "cluster_keyspace");
        config.setConnectionLimiterMaxPendingCount(10);
        config.setConnectionLimiterWindowSize(1000);

        SimpleRateLimiterImpl limit = new SimpleRateLimiterImpl(config);

        int time = 0;
        int interval = 100;
View Full Code Here

                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                                + "_" + TEST_KEYSPACE_NAME)
                                .setSocketTimeout(30000)
                                .setMaxTimeoutWhenExhausted(2000)
                                .setMaxConnsPerHost(10)
                                .setInitConnsPerHost(10)
View Full Code Here

        new AstyanaxConfigurationImpl()
        .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
        .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
        .setDiscoveryDelayInSeconds(60000))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                + "_" + TEST_KEYSPACE_NAME)
            .setSocketTimeout(30000)
            .setMaxTimeoutWhenExhausted(2000)
            .setMaxConnsPerHost(20)
            .setInitConnsPerHost(10)
View Full Code Here

                .forCluster(TEST_CLUSTER_NAME)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.NONE))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME)
                                .setMaxConnsPerHost(1).setSeeds(
                                        "localhost:7102"))
                .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
                .buildCluster(ThriftFamilyFactory.getInstance());
View Full Code Here

                .forCluster(TEST_CLUSTER_NAME)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.NONE))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME)
                                .setMaxConnsPerHost(1).setSeeds(SEEDS))
                .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
                .buildCluster(ThriftFamilyFactory.getInstance());

        clusterContext.start();
View Full Code Here

                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
                                .setDiscoveryDelayInSeconds(60000))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                                + "_" + TEST_KEYSPACE_NAME)
                                .setSocketTimeout(30000)
                                .setMaxTimeoutWhenExhausted(2000)
                                .setMaxConnsPerHost(20)
                                .setInitConnsPerHost(10)
View Full Code Here

    .withAstyanaxConfiguration(
        new AstyanaxConfigurationImpl()
        .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
        .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                + "_" + TEST_KEYSPACE_NAME)
            .setSocketTimeout(30000)
            .setMaxTimeoutWhenExhausted(2000)
            .setMaxConnsPerHost(20)
            .setInitConnsPerHost(10)
View Full Code Here

                .setCqlVersion("3.0.0")
                .setTargetCassandraVersion("1.2")
                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                                + "_" + TEST_KEYSPACE_NAME)
                        .setSocketTimeout(30000)
                        .setMaxTimeoutWhenExhausted(2000)
                        .setMaxConnsPerHost(20)
                        .setInitConnsPerHost(10)
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl

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.