Package me.prettyprint.cassandra.service

Examples of me.prettyprint.cassandra.service.ThriftCfDef


  public List<ColumnFamilyDefinition> getColumnFamilyDefinitions() {
    List<ColumnFamilyDefinition> list = new ArrayList<ColumnFamilyDefinition>();
    for (String key: this.columnFamilyDefinitions.keySet()) {
      ColumnFamilyDefinition columnFamilyDefinition = this.columnFamilyDefinitions.get(key);
      ThriftCfDef thriftCfDef = new ThriftCfDef(columnFamilyDefinition);
      list.add(thriftCfDef);
    }
   
    return list;
  }
View Full Code Here


      List<ColumnFamilyDefinition> cfDefs) {
    return new ThriftKsDef(keyspaceName, strategyClass, replicationFactor, cfDefs);
  }

  public static ColumnFamilyDefinition createColumnFamilyDefinition(String keyspace, String cfName) {
    return new ThriftCfDef(keyspace, cfName);
  }
View Full Code Here

  public static ColumnFamilyDefinition createColumnFamilyDefinition(String keyspace, String cfName) {
    return new ThriftCfDef(keyspace, cfName);
  }

  public static ColumnFamilyDefinition createColumnFamilyDefinition(String keyspace, String cfName, ComparatorType comparatorType) {
    return new ThriftCfDef(keyspace, cfName, comparatorType);
  }
View Full Code Here

  public static ColumnFamilyDefinition createColumnFamilyDefinition(String keyspace, String cfName, ComparatorType comparatorType) {
    return new ThriftCfDef(keyspace, cfName, comparatorType);
  }

  public static ColumnFamilyDefinition createColumnFamilyDefinition(String keyspace, String cfName, ComparatorType comparatorType, List<ColumnDefinition> columnMetadata) {
    return new ThriftCfDef(keyspace, cfName, comparatorType, columnMetadata);
  }
View Full Code Here

          + e.getMessage());
    }

    for (CfDef cfDef : cfDefList) {
      try {
        cluster.addColumnFamily(new ThriftCfDef(cfDef));
      }
      catch (Throwable e) {
        System.out.println("exception while creating CF, " + cfDef.getName() + " - probably already exists : "
            + e.getMessage());
      }
View Full Code Here

            BasicColumnFamilyDefinition columnFamilyDefinition = new BasicColumnFamilyDefinition();
            columnFamilyDefinition.setKeyspaceName(Constants.KEYSPACE_NAME);
            columnFamilyDefinition.setName(Constants.COL_FAMILY_NAME);
            columnFamilyDefinition.setComparatorType(ComparatorType.LONGTYPE);

            ColumnFamilyDefinition cfDef = new ThriftCfDef(columnFamilyDefinition);

            KeyspaceDefinition keyspaceDefinition =
                    HFactory.createKeyspaceDefinition(Constants.KEYSPACE_NAME,
                                                      SimpleStrategy.class.getName(), 1, Arrays.asList(cfDef));
View Full Code Here

        }

        try {
            Cluster cluster = getCluster(null);
            if (isAdd) {
                cluster.addColumnFamily(new ThriftCfDef(familyDefinition));
            } else {
                cluster.updateColumnFamily(new ThriftCfDef(familyDefinition));
            }
        } catch (HectorException e) {
            throw new CassandraServerManagementException("Error " + (isAdd ? "adding" : "updating ") + " a column family with" +
                    " the name :" + columnFamilyName, e, log);
        }
View Full Code Here

     */
    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());
        mutator.insert("keyone", "CFone", HFactory.createStringColumn("name", "C Ronaldo"));
        ColumnQuery<String, String, String> columnQuery =
                HFactory.createStringColumnQuery(keyspace);
View Full Code Here

        bcdf.setIndexName(idxColumnName + "index");
        bcdf.setIndexType(ColumnIndexType.KEYS);
        bcdf.setValidationClass(ComparatorType.UTF8TYPE.getClassName());

        columnFamilyDefinition.addColumnDefinition(bcdf);
        cluster.updateColumnFamily(new ThriftCfDef(columnFamilyDefinition));

    }
View Full Code Here

  public List<ColumnFamilyDefinition> getColumnFamilyDefinitions() {
    List<ColumnFamilyDefinition> list = new ArrayList<ColumnFamilyDefinition>();
    for (String key: this.columnFamilyDefinitions.keySet()) {
      ColumnFamilyDefinition columnFamilyDefinition = this.columnFamilyDefinitions.get(key);
      ThriftCfDef thriftCfDef = new ThriftCfDef(columnFamilyDefinition);
      list.add(thriftCfDef);
    }
   
    return list;
  }
View Full Code Here

TOP

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

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.