Package me.prettyprint.cassandra.service

Examples of me.prettyprint.cassandra.service.CassandraHostConfigurator


                Map<String, String> credentials = new HashMap<String, String>();
                credentials.put(USERNAME_KEY, username);
                credentials.put(PASSWORD_KEY, clusterInformation.getPassword());

                CassandraHostConfigurator configurator = clusterInformation.getCassandraHostConfigurator();
                if (configurator == null) {
                    configurator = createCassandraHostConfigurator();
                }

                cluster = HFactory.createCluster(clusterName, configurator, credentials);
View Full Code Here


        String cassandraHosts = configuration.getNodesString();
        if (cassandraHosts == null || "".equals(cassandraHosts)) {
            cassandraHosts = DEFAULT_HOST;
        }

        CassandraHostConfigurator configurator = new CassandraHostConfigurator(cassandraHosts);
        configurator.setAutoDiscoverHosts(configuration.isAutoDiscovery());
        configurator.setAutoDiscoveryDelayInSeconds(configuration.getAutoDiscoveryDelay());
        configurator.setPort(configuration.getDefaultPort());
        return configurator;
    }
View Full Code Here

        Map<String, String> credentials =
                new HashMap<String, String>();
        credentials.put(USERNAME_KEY, "admin");
        credentials.put(PASSWORD_KEY, "admin");
        return HFactory.createCluster("ClusterOne",
                new CassandraHostConfigurator("localhost:9160"), credentials);
    }
View Full Code Here

    }
   
    private static Cluster retrieveCassandraCluster(String clusterName, String connectionUrl,
        Map<String, String> credentials) {

        CassandraHostConfigurator hostConfigurator = new CassandraHostConfigurator(connectionUrl);
        hostConfigurator.setRetryDownedHosts(false);
        Cluster cluster = HFactory.createCluster(clusterName, hostConfigurator, credentials);
        return cluster;
    }
View Full Code Here

    // get cassandra mapping with persistent class
    this.persistentClass = persistentClass;
    this.cassandraMapping = CassandraMappingManager.getManager().get(persistentClass);

    this.cluster = HFactory.getOrCreateCluster(this.cassandraMapping.getClusterName(),
        new CassandraHostConfigurator(this.cassandraMapping.getHostName()));
   
    // add keyspace to cluster
    checkKeyspace();
   
    // Just create a Keyspace object on the client side, corresponding to an already
View Full Code Here

    private final CassandraBuilder builder = IoCs.findOrCreateInstance(CassandraBuilder.class);
    private final Cluster cluster;
    private final Keyspace keyspace;

    public CassandraSirona() {
        final CassandraHostConfigurator configurator = new CassandraHostConfigurator(builder.getHosts());
        configurator.setMaxActive(builder.getMaxActive());

        cluster = HFactory.getOrCreateCluster(builder.getCluster(), configurator);

        final String keyspaceName = builder.getKeyspace();
View Full Code Here

    public void setActive(boolean active) {
        this.active = active;
    }
   
    public Cluster createCluster() {
        return new ThriftCluster(clusterName, new CassandraHostConfigurator(hosts));
    }
View Full Code Here

    // get cassandra mapping with persistent class
    this.persistentClass = persistentClass;
    this.cassandraMapping = CassandraMappingManager.getManager().get(persistentClass);

    this.cluster = HFactory.getOrCreateCluster(this.cassandraMapping.getClusterName(), new CassandraHostConfigurator(this.cassandraMapping.getHostName()));
   
    // add keyspace to cluster
    checkKeyspace();
   
    // Just create a Keyspace object on the client side, corresponding to an already existing keyspace with already created column families.
View Full Code Here

    }
   
    private static Cluster retrieveCassandraCluster(String clusterName, String connectionUrl,
        Map<String, String> credentials) {

        CassandraHostConfigurator hostConfigurator = new CassandraHostConfigurator(connectionUrl);
        hostConfigurator.setRetryDownedHosts(false);
        Cluster cluster = HFactory.createCluster(clusterName, hostConfigurator, credentials);
        return cluster;
    }
View Full Code Here

    private static void dropKeyspaces() {
        String host = DatabaseDescriptor.getRpcAddress().getHostName();
        int port = DatabaseDescriptor.getRpcPort();
        log.debug("Cleaning cassandra keyspaces on " + host + ":" + port);
        Cluster cluster = HFactory.getOrCreateCluster("TestCluster", new CassandraHostConfigurator(host + ":" + port));
        /* get all keyspace */
        List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();

        /* drop all keyspace except internal cassandra keyspace */
        for (KeyspaceDefinition keyspaceDefinition : keyspaces) {
View Full Code Here

TOP

Related Classes of me.prettyprint.cassandra.service.CassandraHostConfigurator

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.