Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Keyspace


        is(ComparatorType
            .getByClassName(
                "CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.IntegerType)")
            .getTypeName()));

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

    SliceQuery<String, Composite, String> query = HFactory.createSliceQuery(keyspace, StringSerializer.get(),
        new CompositeSerializer(), StringSerializer.get());
    query.setColumnFamily("columnFamilyWithCompositeType");
    query.setKey("row1");
View Full Code Here


        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(),
        StringSerializer.get(), StringSerializer.get());
    Composite key = new Composite();
    key.addComponent(12L, LongSerializer.get());
View Full Code Here

    {
        String clusterName = "TestCluster";
        String host = "localhost:9171";

        Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
        Keyspace keyspace = HFactory.createKeyspace("beautifulKeyspaceName", cluster);
        assertNotNull(keyspace);

        String keyspaceName = "Presto_Database";
        String columnFamilyName = "Presto_Test";
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
View Full Code Here

    {
        String clusterName = "TestCluster";
        String host = "localhost:9171";

        Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
        Keyspace keyspace = HFactory.createKeyspace("beautifulKeyspaceName", cluster);
        assertNotNull(keyspace);

        String keyspaceName = "Presto_Database";
        String columnFamilyName = "Presto_Test";
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
View Full Code Here

  @Test
  public void mockingBirdDemo() {

    KeyspaceDefinition ksDef = HFactory.createKeyspaceDefinition("mockingbird");
    cluster.addKeyspace(ksDef, true);
    Keyspace moch = HFactory.createKeyspace("mockingbird", cluster);
    CqlQuery<String, String, String> cqlQuery = new CqlQuery<String, String, String>(moch, StringSerializer.get(), StringSerializer.get(), StringSerializer.get());
    cqlQuery.setQuery("create columnfamily mockingbird (key 'org.apache.cassandra.db.marshal.UTF8Type' primary key) with  "
            + "comparator = 'org.apache.cassandra.db.marshal.UTF8Type' "
            + "and default_validation = 'CounterColumnType' ");
    QueryResult<CqlRows<String, String, String>> result = cqlQuery.execute();
View Full Code Here

  @Test
  public void mapReduceJoin() {

     KeyspaceDefinition ksDef = HFactory.createKeyspaceDefinition("mr");
    cluster.addKeyspace(ksDef, true);
    Keyspace mr = HFactory.createKeyspace("mr", cluster);
    CqlQuery<String, String, String> cqlQuery = new CqlQuery<String, String, String>(mr, StringSerializer.get(), StringSerializer.get(), StringSerializer.get());
    cqlQuery.setQuery("create columnfamily dollarbyuser (key 'org.apache.cassandra.db.marshal.UTF8Type' primary key) with  "
            + "comparator = 'org.apache.cassandra.db.marshal.UTF8Type' "
            + "and default_validation = 'CounterColumnType' ");
    QueryResult<CqlRows<String, String, String>> result = cqlQuery.execute();
View Full Code Here

    {
        String clusterName = "TestCluster";
        String host = "localhost:9171";

        Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
        Keyspace keyspace = HFactory.createKeyspace("beautifulKeyspaceName", cluster);
        assertNotNull(keyspace);

        String keyspaceName = "Presto_Database";
        String columnFamilyName = "Presto_Test";
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
View Full Code Here

    {
        String clusterName = "TestCluster";
        String host = "localhost:9171";

        Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
        Keyspace keyspace = HFactory.createKeyspace("beautifulKeyspaceName", cluster);
        assertNotNull(keyspace);

        String keyspaceName = "Presto_Database";
        String columnFamilyName = "Presto_Test";
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
View Full Code Here

    {
        String clusterName = "TestCluster";
        String host = "localhost:9171";

        Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
        Keyspace keyspace = HFactory.createKeyspace("beautifulKeyspaceName", cluster);
        assertNotNull(keyspace);

        String keyspaceName = "presto_database";
        String columnFamilyName = "presto_test";
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
View Full Code Here

    }

    public static void createTestData(String keyspaceName, String columnFamilyName)
    {
        List<ColumnFamilyDefinition> columnFamilyDefinitions = createColumnFamilyDefinitions(keyspaceName, columnFamilyName);
        Keyspace keyspace = createOrReplaceKeyspace(keyspaceName, columnFamilyDefinitions);

        Mutator<String> mutator = HFactory.createMutator(keyspace, StringSerializer.get());

        long timestamp = System.currentTimeMillis();
        for (int rowNumber = 1; rowNumber < 10; rowNumber++) {
View Full Code Here

TOP

Related Classes of me.prettyprint.hector.api.Keyspace

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.