Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Cluster


    try {
      dataLoader.load(MockDataSetHelper.getMockDataSetWithDefinedValuesSimple());

      /* verify */
      Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
      Keyspace keyspace = HFactory.createKeyspace("otherKeyspaceName", cluster);
      SliceCounterQuery<Long, String> query = HFactory.createCounterSliceQuery(keyspace, LongSerializer.get(),
          StringSerializer.get());
      query.setColumnFamily("beautifulColumnFamilyName6");
      query.setKey(10L);
View Full Code Here


    try {
      dataLoader.load(MockDataSetHelper.getMockDataSetWithDefinedValuesSimple());

      /* verify */
      Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
      Keyspace keyspace = HFactory.createKeyspace("otherKeyspaceName", cluster);
      SuperSliceCounterQuery<Long, String, String> query = HFactory.createSuperSliceCounterQuery(keyspace,
          LongSerializer.get(), StringSerializer.get(), StringSerializer.get());
      query.setColumnFamily("beautifulColumnFamilyName7").setKey(10L);
      query.setRange(null, null, false, 100);
View Full Code Here

    LoadingOption loadingOption = new LoadingOption();
    loadingOption.setOnlySchema(true);
    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefaultValues(), loadingOption);

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertDefaultValuesSchemaExist(cluster);

    assertDefaultValuesDataIsEmpty(cluster);
  }
View Full Code Here

    LoadingOption loadingOption = new LoadingOption();
    loadingOption.setReplicationFactor(1);
    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));
  }
View Full Code Here

    loadingOption.setStrategy(StrategyModel.SIMPLE_STRATEGY);

    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

        try {
            dataLoader.load(MockDataSetHelper.getMockDataSetWithReversedComparatorOnSimpleType());

      /* verify */
            Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
            Keyspace keyspace = HFactory.createKeyspace("reversedKeyspace", cluster);
            RangeSlicesQuery<String, String, String> query = HFactory.createRangeSlicesQuery(keyspace, StringSerializer.get(), StringSerializer.get(),
                    StringSerializer.get());
            query.setColumnFamily("columnFamilyWithReversedComparatorOnSimpleType");
            query.setRange(null, null, false, Integer.MAX_VALUE);
View Full Code Here

        try {
            dataLoader.load(MockDataSetHelper.getMockDataSetWithReversedComparatorOnCompositeTypes());

      /* verify */
            Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
            Keyspace keyspace = HFactory.createKeyspace("reversedKeyspace", cluster);
            RangeSlicesQuery<String, Composite, String> query = HFactory.createRangeSlicesQuery(keyspace, StringSerializer.get(), CompositeSerializer.get(),
                    StringSerializer.get());
            query.setColumnFamily("columnFamilyWithReversedCompOnCompositeTypes");
            query.setRange(null, null, false, Integer.MAX_VALUE);
View Full Code Here

        try {
            dataLoader.load(MockDataSetHelper.getMockDataSetWithBinaryData());

      /* verify */
            Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
            Keyspace keyspace = HFactory.createKeyspace("binaryKeyspace", cluster);
            RangeSlicesQuery<String, String, byte[]> query = HFactory.createRangeSlicesQuery(keyspace, StringSerializer.get(), StringSerializer.get(),
                    BytesArraySerializer.get());
            query.setColumnFamily("columnFamilyWithBinaryData");
            query.setRange(null, null, false, Integer.MAX_VALUE);
View Full Code Here

    String clusterName = "TestClusterCompositeType01";
    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(
                "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 clusterName = "TestClusterCompositeType02";
    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)"));

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

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

TOP

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

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.