Search in sources :

Example 1 with TriggerDef

use of org.apache.cassandra.thrift.TriggerDef in project atlasdb by palantir.

the class ColumnFamilyDefinitions method getStandardCfDef.

/**
 *  Provides a basic column family definition. This is a subset of #getCfDef, and does not
 *  include compression options, but also does not require raw metadata to be passed in.
 *
 *  Warning to developers: you must update CKVS.isMatchingCf if you update this method
 */
static CfDef getStandardCfDef(String keyspace, String internalTableName) {
    CfDef cf = new CfDef(keyspace, internalTableName);
    cf.setComparator_type("CompositeType(BytesType,LongType)");
    cf.setCompaction_strategy(CassandraConstants.LEVELED_COMPACTION_STRATEGY);
    cf.setCompression_options(Maps.<String, String>newHashMap());
    cf.setGc_grace_seconds(CassandraConstants.DEFAULT_GC_GRACE_SECONDS);
    // explicitly set fields to default values
    cf.setCaching("KEYS_ONLY");
    cf.setDclocal_read_repair_chance(0.1);
    cf.setTriggers(new ArrayList<TriggerDef>());
    cf.setCells_per_row_to_cache("0");
    cf.setMin_index_interval(128);
    cf.setMax_index_interval(2048);
    cf.setComment("");
    cf.setColumn_metadata(new ArrayList<ColumnDef>());
    cf.setMin_compaction_threshold(4);
    cf.setMax_compaction_threshold(32);
    cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType");
    cf.setCompaction_strategy_options(new HashMap<String, String>());
    cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType");
    return cf;
}
Also used : ColumnDef(org.apache.cassandra.thrift.ColumnDef) TriggerDef(org.apache.cassandra.thrift.TriggerDef) CfDef(org.apache.cassandra.thrift.CfDef)

Aggregations

CfDef (org.apache.cassandra.thrift.CfDef)1 ColumnDef (org.apache.cassandra.thrift.ColumnDef)1 TriggerDef (org.apache.cassandra.thrift.TriggerDef)1