Package com.netflix.astyanax.connectionpool.impl

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


        .forCluster("ClusterName")
        .withAstyanaxConfiguration(new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE))
        .withConnectionPoolConfiguration(
                new ConnectionPoolConfigurationImpl("MyConnectionPool").setPort(9160).setMaxConnsPerHost(1)
                        .setSeeds(hostString))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor());
    }
View Full Code Here


        ConnectionPoolConfiguration connectionPoolConfiguration = new ConnectionPoolConfigurationImpl("AstyanaxPool")
                .setPort(port)
                .setMaxConnsPerHost(1)
                .setSeeds(cassandraHostname + ":" + port);

        ConnectionPoolMonitor connectionPoolMonitor = new CountingConnectionPoolMonitor();

        ThriftFamilyFactory factory = ThriftFamilyFactory.getInstance();

        context = new AstyanaxContext.Builder()
                .forCluster(cassandraClusterName)
View Full Code Here

                poolConfig.setSeeds(StringUtils.join(endpoints, ":" + port + ","));
                poolConfig.setLatencyScoreStrategy(latencyScoreStrategy);

                logger.info("ConnectionPoolConfiguration: " + poolConfig.toString());

                ConnectionPoolMonitor connectionPoolMonitor = new CountingConnectionPoolMonitor();
                // set this as field for logging purpose only.
                Builder builder = new AstyanaxContext.Builder();
                builder.forCluster(getClusterName());
                builder.forKeyspace(getKeyspaceName());
                builder.withAstyanaxConfiguration(configuration);
                builder.withConnectionPoolConfiguration(poolConfig);
                builder.withConnectionPoolMonitor(connectionPoolMonitor);
                builder.withConnectionPoolMonitor(new CountingConnectionPoolMonitor());

                context = builder.buildKeyspace(ThriftFamilyFactory.getInstance());
                context.start();
                keyspace = context.getEntity();
                return keyspace;
View Full Code Here

          .setMaxConnsPerHost(20)
          .setInitConnsPerHost(2)
          .setSeeds(seeds2)
          .setConnectTimeout(10000)
      )
      .withConnectionPoolMonitor(new CountingConnectionPoolMonitor());
   
   
  if(seeds2.contains(",")) {
    //for a multi-node cluster, we want the test suite using quorum on writes and
    //reads so we have no issues...
View Full Code Here

          .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
          .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
    .setClock(new MicrosecondsAsyncClock())
      )
      .withConnectionPoolConfiguration(poolConfig)
      .withConnectionPoolMonitor(new CountingConnectionPoolMonitor());

    String clStr = (String) properties.get(Bootstrap.CASSANDRA_DEFAULT_CONSISTENCY_LEVEL);
    if(clStr != null) {
      ConsistencyLevel cl = null;
      for(ConsistencyLevel l : ConsistencyLevel.values()) {
View Full Code Here

        .forCluster(CLUSTER_NAME)
        .forKeyspace(config.getKeyspace())
        .withAstyanaxConfiguration(new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl("MyConnectionPool").setMaxConnsPerHost(10)
                .setSeeds(config.getHost())).withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());
    this.astyanaxContext.start();
    this.keyspace = this.astyanaxContext.getEntity();
    this.config = config;
    indexStorage = new CassandraChunkedStorageProvider(keyspace, INDEX_TABLE_NAME);
View Full Code Here

                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE))
        .withConnectionPoolConfiguration(
            new ConnectionPoolConfigurationImpl("MyConnectionPool")
                .setPort(9160).setMaxConnsPerHost(1)
                .setSeeds("127.0.0.1:9160"))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());

    context.start();
    keyspace = context.getClient();
  }
View Full Code Here

                        + "_" + MetaConstants.META_KEY_SPACE)
                        .setSocketTimeout(3000)
                        .setMaxTimeoutWhenExhausted(2000)
                        .setMaxConnsPerHost(3).setInitConnsPerHost(1)
                        .setSeeds(clusterNameOnly+":"+clusterPortOnly))  //uncomment for localhost
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());
        keyspaceContext.start();
        Keyspace keyspace;
        keyspace = keyspaceContext.getClient();
        return keyspace;
View Full Code Here

                + "_" + 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)
View Full Code Here

                new ConnectionPoolConfigurationImpl(clusterNameOnly
                        + "_" + MetaConstants.META_KEY_SPACE)
                        .setSocketTimeout(11000)
                        .setConnectTimeout(2000)
                        .setMaxConnsPerHost(10).setInitConnsPerHost(3))
        .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
        .buildKeyspace(ThriftFamilyFactory.getInstance());
        keyspaceContext.start();
        Keyspace keyspace;
        keyspace = keyspaceContext.getClient();
        return keyspace;
View Full Code Here

TOP

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

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.