Examples of describeKeyspace()


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

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    String keyspaceName = "otherKeyspaceName";
    assertThat(cluster.describeKeyspace(keyspaceName), notNullValue());
        List<ColumnFamilyDefinition> columnFamilyDefinitions = cluster.describeKeyspace(keyspaceName).getCfDefs();
        assertThat(columnFamilyDefinitions, notNullValue());
    assertThat(columnFamilyDefinitions.size(), is(5));

        Map<String,ColumnFamilyDefinition> columnFamilyDefinitionsMap = Maps.uniqueIndex(columnFamilyDefinitions, new Function<ColumnFamilyDefinition, String>() {
            @Override
View Full Code Here

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

    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefaultValuesAndReplicationFactor2(), loadingOption);

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertDefaultValuesSchemaExist(cluster);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), not(2));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), is(1));
  }

  @Test
  public void shouldLoadDataSetButOverrideStrategy() throws Exception {
View Full Code Here

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

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertDefaultValuesSchemaExist(cluster);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), not(2));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), is(1));
  }

  @Test
  public void shouldLoadDataSetButOverrideStrategy() throws Exception {
    String clusterName = "TestCluster14";
View Full Code Here

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

    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefaultValuesAndNetworkTopologyStrategy(), loadingOption);

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertDefaultValuesSchemaExist(cluster);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        not("org.apache.cassandra.locator.NetworkTopologyStrategy"));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        is("org.apache.cassandra.locator.SimpleStrategy"));
  }

View Full Code Here

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

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertDefaultValuesSchemaExist(cluster);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        not("org.apache.cassandra.locator.NetworkTopologyStrategy"));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        is("org.apache.cassandra.locator.SimpleStrategy"));
  }

    @Test
    public void shouldLoadDataWithReversedComparatorOnSimpleType() {
View Full Code Here

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

    String host = "localhost:9171";
    DataLoader dataLoader = new DataLoader(clusterName, host);
    dataLoader.load(MockDataSetHelper.getMockDataSetWithCompositeType());
    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(0).getName(),
        is("columnFamilyWithCompositeType"));
    assertThat(
        cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(0).getComparatorType().getTypeName(),
        is(ComparatorType
            .getByClassName(
View Full Code Here

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

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(0).getName(),
        is("columnFamilyWithCompositeType"));
    assertThat(
        cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(0).getComparatorType().getTypeName(),
        is(ComparatorType
            .getByClassName(
                "CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.IntegerType)")
            .getTypeName()));

View Full Code Here

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

    String host = "localhost:9171";
    DataLoader dataLoader = new DataLoader(clusterName, host);
    dataLoader.load(MockDataSetHelper.getMockDataSetWithCompositeType());
    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(1).getName(),
        is("columnFamilyWithRowKeyCompositeType"));
    assertThat(
        cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(1).getKeyValidationClass(),
        is("org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type)"));

View Full Code Here

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

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(1).getName(),
        is("columnFamilyWithRowKeyCompositeType"));
    assertThat(
        cluster.describeKeyspace("compositeKeyspace").getCfDefs().get(1).getKeyValidationClass(),
        is("org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type)"));

    Keyspace keyspace = HFactory.createKeyspace("compositeKeyspace", cluster);

    SliceQuery<Composite, String, String> query = HFactory.createSliceQuery(keyspace, new CompositeSerializer(),
View Full Code Here

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

                keyspaceName,
                StrategyModel.SIMPLE_STRATEGY.value(),
                1,
                columnFamilyDefinitions);

        if (cluster.describeKeyspace(keyspaceName) != null) {
            cluster.dropKeyspace(keyspaceName, true);
        }
        cluster.addKeyspace(keyspaceDefinition, true);
        keyspace = HFactory.createKeyspace(keyspaceName, cluster);
        Mutator<String> mutator = HFactory.createMutator(keyspace, StringSerializer.get());
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.