Examples of describeKeyspaces()


Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

     *          for errors during accessing keyspaces
     */
    private String[] getKeyspaces(ClusterInformation clusterInformation) throws CassandraServerManagementException {
        Cluster cluster = getCluster(clusterInformation);
        List<String> keyspaceNames = new ArrayList<String>();
        for (KeyspaceDefinition keyspaceDefinition : cluster.describeKeyspaces()) {
            String name = keyspaceDefinition.getName();
            if (name != null && !"".equals(name)) {
                keyspaceNames.add(name);
            }
        }
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

                                              
            cluster.addKeyspace(keyspaceDefinition);
           
            // insert some data
           
            List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
            for (KeyspaceDefinition kd : keyspaces) {
                if ( kd.getName().equals(DYN_KEYSPACE) ) {
                    System.out.println("Name: " +kd.getName());
                    System.out.println("RF: " +kd.getReplicationFactor());
                    System.out.println("strategy class: " +kd.getStrategyClass());
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

    test();
  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));

    Keyspace keyspace = HFactory.createKeyspace("mykeyspacename", cluster);
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

    test();
  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));

    Keyspace keyspace = HFactory.createKeyspace("mykeyspacename", cluster);
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

    test();
  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

  }

  private void test() throws Exception {
    Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", "localhost:9171");
    List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces();
    assertThat(cluster.describeKeyspaces(), notNullValue());
    assertThat(keyspaces.size(), is(3));
    assertThat(cluster.describeKeyspace("mykeyspacename"), notNullValue());
    assertThat(cluster.describeKeyspace("mykeyspacename").getName(), is("mykeyspacename"));

    Keyspace keyspace = HFactory.createKeyspace("mykeyspacename", cluster);
View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

        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) {
            String keyspaceName = keyspaceDefinition.getName();

View Full Code Here

Examples of me.prettyprint.hector.api.Cluster.describeKeyspaces()

        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) {
            String keyspaceName = keyspaceDefinition.getName();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.