Package me.prettyprint.hector.api

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


    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefaultValues());

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName"), notNullValue());
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), is(1));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        is("org.apache.cassandra.locator.SimpleStrategy"));

  }
View Full Code Here


    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefaultValues());

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName"), notNullValue());
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), is(1));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        is("org.apache.cassandra.locator.SimpleStrategy"));

  }

View Full Code Here

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName"), notNullValue());
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getReplicationFactor(), is(1));
    assertThat(cluster.describeKeyspace("beautifulKeyspaceName").getStrategyClass(),
        is("org.apache.cassandra.locator.SimpleStrategy"));

  }

  @Test
View Full Code Here

    dataLoader.load(MockDataSetHelper.getMockDataSetWithSchemaAndDefaultColumnValueValidator());

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("keyspace"), notNullValue());
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getName(), is("columnFamily"));
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getDefaultValidationClass(),
        is(ComparatorType.LONGTYPE.getClassName()));
  }

View Full Code Here

    dataLoader.load(MockDataSetHelper.getMockDataSetWithSchemaAndDefaultColumnValueValidator());

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("keyspace"), notNullValue());
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getName(), is("columnFamily"));
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getDefaultValidationClass(),
        is(ComparatorType.LONGTYPE.getClassName()));
  }

  @Test
View Full Code Here

    /* test */
    Cluster cluster = HFactory.getOrCreateCluster(clusterName, host);
    assertThat(cluster.describeKeyspace("keyspace"), notNullValue());
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getName(), is("columnFamily"));
    assertThat(cluster.describeKeyspace("keyspace").getCfDefs().get(0).getDefaultValidationClass(),
        is(ComparatorType.LONGTYPE.getClassName()));
  }

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

    dataLoader.load(MockDataSetHelper.getMockDataSetWithDefinedValues());

    /* 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>() {
View Full Code Here

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

    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

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

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.