Package me.prettyprint.hector.api

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


    /* 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

    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

    /* 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

    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

    /* 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

                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

                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

        this.snapshotCFName = eventCFName + "Snapshot";

        //connect to cluster
        Cluster cluster = HFactory.getOrCreateCluster(clusterName, hosts);
        //dynamically create keyspace
        KeyspaceDefinition keyspaceDefinition = cluster.describeKeyspace(keyspaceName);
        if (keyspaceDefinition == null) {
            ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(
                    keyspaceName, eventCFName, ComparatorType.COMPOSITETYPE);
            cfDef.setComparatorTypeAlias("(LongType, UTF8Type)");
View Full Code Here

                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.