Package com.netflix.astyanax.connectionpool.impl

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


        .forKeyspace(KS)
        .withAstyanaxConfiguration(
            new AstyanaxConfigurationImpl()
                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl("MyConnectionPool")
                .setPort(9160).setMaxConnsPerHost(1)
                .setSeeds("127.0.0.1:9160"))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());
View Full Code Here


                                ConnectionPoolType.ROUND_ROBIN)
                        .setTargetCassandraVersion("1.2")
                        .setCqlVersion("3.0.0"))
//                        .withHostSupplier(hs.getSupplier(clustername))
        .withConnectionPoolConfiguration(
                new ConnectionPoolConfigurationImpl("localpool"
                        + "_" + MetaConstants.META_KEY_SPACE)
                        .setSocketTimeout(30000)
                        .setMaxTimeoutWhenExhausted(20000)
                        .setMaxConnsPerHost(3).setInitConnsPerHost(1)
                        .setSeeds("localhost"+":"+"9160"))  //uncomment for localhost
View Full Code Here

                        .setDiscoveryDelayInSeconds(60000)
                        .setTargetCassandraVersion("1.1")
                        .setCqlVersion("3.0.0"))
//                        .withHostSupplier(hs.getSupplier(clustername))
        .withConnectionPoolConfiguration(
                new ConnectionPoolConfigurationImpl(clusterNameOnly
                        + "_" + MetaConstants.META_KEY_SPACE)
                        .setSocketTimeout(3000)
                        .setMaxTimeoutWhenExhausted(2000)
                        .setMaxConnsPerHost(3).setInitConnsPerHost(1)
                        .setSeeds(clusterNameOnly+":"+clusterPortOnly))  //uncomment for localhost
View Full Code Here

                .setDiscoveryDelayInSeconds(60)
                .setTargetCassandraVersion("1.2")
                .setCqlVersion("3.0.0"))
        .withHostSupplier(supplier.getSupplier(clustername))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl(clusterNameOnly
                + "_" + db)
                .setSocketTimeout(10000)
                .setPort(7102)
                .setMaxConnsPerHost(10).setInitConnsPerHost(3)
                .setSeeds(null))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());
    } else {
      keyspaceContext = new AstyanaxContext.Builder()
          .forCluster(clusterNameOnly)
          .forKeyspace(db)
          .withAstyanaxConfiguration(
                  new AstyanaxConfigurationImpl()
                          .setDiscoveryType(
                                  NodeDiscoveryType.RING_DESCRIBE)
                          .setConnectionPoolType(
                                  ConnectionPoolType.TOKEN_AWARE)
                          .setDiscoveryDelayInSeconds(60)
                          .setTargetCassandraVersion("1.2")
                          .setCqlVersion("3.0.0"))
                          //.withHostSupplier(hs.getSupplier(clustername))
          .withConnectionPoolConfiguration(
                  new ConnectionPoolConfigurationImpl(clusterNameOnly
                          + "_" + db)
                          .setSocketTimeout(11000)
                          .setConnectTimeout(2000)
                          .setMaxConnsPerHost(10).setInitConnsPerHost(3)  
                        .setSeeds(clusterNameOnly+":"+clusterPortOnly))
View Full Code Here

                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
                                .setDiscoveryDelayInSeconds(60000))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(
                                clusterName + "_" + keyspaceName)
                                .setSeeds("localhost:9160"))
                .withConnectionPoolMonitor(new Slf4jConnectionPoolMonitorImpl())
                .buildKeyspace(ThriftFamilyFactory.getInstance()));
       
View Full Code Here

                        .setDiscoveryDelayInSeconds(60)
                        .setTargetCassandraVersion("1.2")
                        .setCqlVersion("3.0.0"))
                        .withHostSupplier(hs.getSupplier(clustername))
        .withConnectionPoolConfiguration(
                new ConnectionPoolConfigurationImpl(clusterNameOnly
                        + "_" + MetaConstants.META_KEY_SPACE)
                        .setSocketTimeout(11000)
                        .setConnectTimeout(2000)
                        .setMaxConnsPerHost(10).setInitConnsPerHost(3))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
View Full Code Here

import com.netflix.paas.cassandra.provider.AstyanaxConnectionPoolConfigurationProvider;

public class DefaultAstyanaxConnectionPoolConfigurationProvider implements AstyanaxConnectionPoolConfigurationProvider {
    @Override
    public ConnectionPoolConfiguration get(String name) {
        return new ConnectionPoolConfigurationImpl(name);
    }
View Full Code Here

        int connsPerHost = maxConns / numHosts + (maxConns % numHosts == 0 ? 0 : 1);
        // This timeout effectively results in waiting a maximum of (timeoutWhenExhausted / numHosts) on each Host
        int timeoutWhenExhausted = config.getIntegerProperty(CoreConfig.MAX_TIMEOUT_WHEN_EXHAUSTED);
        timeoutWhenExhausted = Math.max(timeoutWhenExhausted, 1 * numHosts); // Minimum of 1ms per host

        final ConnectionPoolConfigurationImpl connectionPoolConfiguration = new ConnectionPoolConfigurationImpl("MyConnectionPool")
                .setPort(port)
                .setSocketTimeout(timeout)
                .setInitConnsPerHost(connsPerHost)
                .setMaxConnsPerHost(connsPerHost)
                .setMaxBlockedThreadsPerHost(5)
View Full Code Here

                        .forKeyspace(keyspace)
                .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
                    .setDiscoveryType(discovery)
                    .setRetryPolicy(new RetryNTimes(10)))
                   
                .withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl(host + ":" + keyspace)
                        .setMaxConns(threads * 2)
                        .setSeeds(host)
                        .setPort(port)
                        .setRetryBackoffStrategy(new FixedRetryBackoffStrategy(1000, 1000)))
                .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
View Full Code Here

      .forCluster(clusterName)
      .forKeyspace(keyspace2)
      .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()     
          .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
      )
      .withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
          .setMaxConnsPerHost(2)
          .setInitConnsPerHost(2)
          .setSeeds(seeds2)
      )
      .withConnectionPoolMonitor(new CountingConnectionPoolMonitor());
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.