Package com.netflix.astyanax.impl

Examples of com.netflix.astyanax.impl.AstyanaxConfigurationImpl


    public static void createKeyspace() throws Exception {
        keyspaceContext = new AstyanaxContext.Builder()
                .forCluster(TEST_CLUSTER_NAME)
                .forKeyspace(TEST_KEYSPACE_NAME)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
                                .setDiscoveryDelayInSeconds(60000))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
View Full Code Here


    public static void createKeyspace() throws Exception {
        keyspaceContext = new AstyanaxContext.Builder()
                .forCluster(TEST_CLUSTER_NAME)
                .forKeyspace(TEST_KEYSPACE_NAME)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
                                .setDiscoveryDelayInSeconds(60000))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
View Full Code Here

    public void testNonExistentKeyspace()  {
        AstyanaxContext<Keyspace> ctx = new AstyanaxContext.Builder()
            .forCluster(TEST_CLUSTER_NAME)
            .forKeyspace(TEST_KEYSPACE_NAME + "_NonExistent")
            .withAstyanaxConfiguration(
                    new AstyanaxConfigurationImpl()
                            .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                            .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
                            .setDiscoveryDelayInSeconds(60000))
            .withConnectionPoolConfiguration(
                    new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
View Full Code Here

    public void example() {
        AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
                .forCluster(TEST_CLUSTER_NAME)
                .forKeyspace(TEST_KEYSPACE_NAME)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.NONE))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl("MyConnectionPool")
                                .setMaxConnsPerHost(1).setSeeds(
                                        "127.0.0.1:9160"))
View Full Code Here

      };
     
      AstyanaxContext<Cluster> context = new AstyanaxContext.Builder()
                .forCluster(clusterName)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                                .setDiscoveryDelayInSeconds(60000))
                .withConnectionPoolConfiguration(
                        new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
                                + "_" + TEST_KEYSPACE_NAME)
View Full Code Here

      };
     
      AstyanaxContext<Cluster> context = new AstyanaxContext.Builder()
      .forCluster(clusterName)
      .withAstyanaxConfiguration(
          new AstyanaxConfigurationImpl()
          .setDiscoveryType(NodeDiscoveryType.DISCOVERY_SERVICE)
          .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
          .setDiscoveryDelayInSeconds(60000))
          .withConnectionPoolConfiguration(
              new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME
View Full Code Here

               new QueryOptions());

    AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
    .forKeyspace(keyspaceName)
    .withHostSupplier(HostSupplier)
    .withAstyanaxConfiguration(new AstyanaxConfigurationImpl())
    .withConnectionPoolConfiguration(new JavaDriverConnectionPoolConfigurationImpl(jdConfig))
    .buildKeyspace(CqlFamilyFactory.getInstance());

      return context;
    }
View Full Code Here

     
      AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
                .forCluster(TEST_CLUSTER_NAME)
                .forKeyspace(keyspaceName)
                .withAstyanaxConfiguration(
                        new AstyanaxConfigurationImpl()
                                .setDiscoveryType(NodeDiscoveryType.DISCOVERY_SERVICE)
                                .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
                                .setDiscoveryDelayInSeconds(60000)
                                .setTargetCassandraVersion("1.2")
                                )
View Full Code Here

    private static Keyspace getKeyspace() throws Exception{
        if (ks == null) {
            try {
                AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
                    .forKeyspace(DynamicPropertyFactory.getInstance().getStringProperty(RSSConstants.CASSANDRA_KEYSPACE, null).get())
                    .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
                        .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
                    )
                    .withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
                        .setPort(DynamicPropertyFactory.getInstance().getIntProperty(RSSConstants.CASSANDRA_PORT, 0).get())
                        .setMaxConnsPerHost(DynamicPropertyFactory.getInstance().getIntProperty(RSSConstants.CASSANDRA_MAXCONNSPERHOST, 1).get())
View Full Code Here

   * @throws ConnectionException
   *             Error establishing a connection with the DB.
   */
  private Database() throws ConnectionException {
    Logger.debug("[Database.Database]");
    AstyanaxConfigurationImpl astconfig = new AstyanaxConfigurationImpl()
        .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE);
   
    ConnectionPoolConfigurationImpl poolconfig = new ConnectionPoolConfigurationImpl(CONNECTIONPOOL_NAME)
        .setPort(DATABASE_POST)
        .setMaxConnsPerHost(1)
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.impl.AstyanaxConfigurationImpl

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.