Package me.prettyprint.cassandra.service

Examples of me.prettyprint.cassandra.service.ThriftKsDef


  public static void createKeyspace(Cluster cluster, String name, String strategy, int replicationFactor,
      List<CfDef> cfDefList) {
    try {
      KsDef ksDef = new KsDef(name, strategy, replicationFactor, cfDefList);
      cluster.addKeyspace(new ThriftKsDef(ksDef));
      return;
    }
    catch (Throwable e) {
      System.out.println("exception while creating keyspace, " + name + " - probably already exists : "
          + e.getMessage());
View Full Code Here


  public static long createClock() {
    return CassandraHostConfigurator.DEF_CLOCK_RESOLUTION.createClock();
  }

  public static KeyspaceDefinition createKeyspaceDefinition(String keyspace) {
    return new ThriftKsDef(keyspace);
  }
View Full Code Here

    return new ThriftKsDef(keyspace);
  }

  public static KeyspaceDefinition createKeyspaceDefinition(String keyspaceName, String strategyClass, int replicationFactor,
      List<ColumnFamilyDefinition> cfDefs) {
    return new ThriftKsDef(keyspaceName, strategyClass, replicationFactor, cfDefs);
  }
View Full Code Here

    /**
     * Create a keyspace, add a column family and read a column's value
     */
    private static void createKeyspace() {
        KeyspaceDefinition definition = new ThriftKsDef("TestKeyspace");
        cluster.addKeyspace(definition);
        Keyspace keyspace = HFactory.createKeyspace("TestKeyspace", cluster);
        ColumnFamilyDefinition familyDefinition = new ThriftCfDef("TestKeyspace", "CFone");
        cluster.addColumnFamily(familyDefinition);
        Mutator<String> mutator = HFactory.createMutator(keyspace, new StringSerializer());
View Full Code Here

        cluster.addColumnFamily(cfDef, true);
    }

    @Override
    public void createKeyspace(QxJsonKeyspaceDefinition qxDef) {
        KeyspaceDefinition ksDef = new ThriftKsDef(qxDef.getKeyspaceName(), qxDef.getStrategyClass(), qxDef.getReplicationFactor(), new ArrayList<ColumnFamilyDefinition>(0));

        cluster.addKeyspace(ksDef, true);
    }
View Full Code Here

        consistencyLevelPolicy.setDefaultReadConsistencyLevel(HConsistencyLevel.ONE);

        KeyspaceDefinition keyspaceDef = cluster.describeKeyspace(cassandraKeyspace);
        if (keyspaceDef == null) {
            log.warn("Keyspace \" {} \" does not exist, creating it!", cassandraKeyspace);
            keyspaceDef = new ThriftKsDef(cassandraKeyspace);
            cluster.addKeyspace(keyspaceDef, true);

            addColumnFamily(cluster, USER_CF, 0);
            addColumnFamily(cluster, FRIENDS_CF, 0);
            addColumnFamily(cluster, FOLLOWERS_CF, 0);
View Full Code Here

   * cluster.addKeyspace(newKeyspace);
   *
   * @param keyspace
   */
  public static KeyspaceDefinition createKeyspaceDefinition(String keyspace) {
    return new ThriftKsDef(keyspace);
  }
View Full Code Here

   *          - http://wiki.apache.org/cassandra/Operations
   */
  public static KeyspaceDefinition createKeyspaceDefinition(
      String keyspaceName, String strategyClass, int replicationFactor,
      List<ColumnFamilyDefinition> cfDefs) {
    return new ThriftKsDef(keyspaceName, strategyClass, replicationFactor,
        cfDefs);
  }
View Full Code Here

TOP

Related Classes of me.prettyprint.cassandra.service.ThriftKsDef

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.