Package me.prettyprint.cassandra.service

Examples of me.prettyprint.cassandra.service.ThriftCfDef


        cluster.truncate(keyspaceName, columnFamily);
    }
   
    @Override
    public void createColumnFamily(QxJsonColumnFamilyDefinition qxDef) {
        ColumnFamilyDefinition cfDef = new ThriftCfDef(qxDef.getKeyspaceName(), qxDef.getName());
        cfDef.setGcGraceSeconds(qxDef.getGcGraceSeconds());
        cfDef.setComment(qxDef.getComment());
        cfDef.setColumnType(ColumnType.getFromValue(qxDef.getColumnType()));
        cfDef.setComparatorType(ComparatorType.getByClassName(qxDef.getComparatorType()));
        if (qxDef.getColumnType().equals(ColumnType.SUPER.getValue())) {
            cfDef.setSubComparatorType(ComparatorType.getByClassName(qxDef.getSubComparatorType()));
        }
        cfDef.setKeyValidationClass(qxDef.getKeyValidationclass());
        cfDef.setDefaultValidationClass(qxDef.getDefaultValidationclass());

        cluster.addColumnFamily(cfDef, true);
    }
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

            superCfDefinition.setName(CF_SUPER);
            superCfDefinition.setColumnType(ColumnType.SUPER);
           
           
           
            ColumnFamilyDefinition cfDefStandard = new ThriftCfDef(columnFamilyDefinition);
            ColumnFamilyDefinition cfDefSuper = new ThriftCfDef(superCfDefinition);
           
            KeyspaceDefinition keyspaceDefinition =
                HFactory.createKeyspaceDefinition(DYN_KEYSPACE, "org.apache.cassandra.locator.SimpleStrategy",
                    1, Arrays.asList(cfDefStandard, cfDefSuper));
                                              
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

  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


    private void addColumnFamilyCounter(ThriftCluster cluster, String cfName, int rowCacheKeysToSave) {
        String cassandraKeyspace = this.env.getProperty("cassandra.keyspace");

        ThriftCfDef cfd =
                new ThriftCfDef(cassandraKeyspace, cfName, ComparatorType.UTF8TYPE);

        cfd.setRowCacheKeysToSave(rowCacheKeysToSave);
        cfd.setDefaultValidationClass(ComparatorType.COUNTERTYPE.getClassName());
        cluster.addColumnFamily(cfd);
    }
View Full Code Here

                // Define column family...
                BasicColumnFamilyDefinition columnFamilyDefinition = new BasicColumnFamilyDefinition();
                columnFamilyDefinition.setKeyspaceName(getProperties().getProperty("schema"));
                columnFamilyDefinition.setName(column_family);

                ColumnFamilyDefinition cfDefStandard = new ThriftCfDef(columnFamilyDefinition);

                KeyspaceDefinition keyspaceDefinition = HFactory.createKeyspaceDefinition(getProperties().getProperty("schema"),
                        "org.apache.cassandra.locator.SimpleStrategy", 1, Arrays.asList(cfDefStandard));

                System.out.println("creating keyspace definition");
View Full Code Here

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

   * @param columnFamilyName
   * @param comparatorType
   */
  public static ColumnFamilyDefinition createColumnFamilyDefinition(
      String keyspace, String cfName, ComparatorType comparatorType) {
    return new ThriftCfDef(keyspace, cfName, comparatorType);
  }
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.