/** * 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(ImmutableList.of()); cf.setCells_per_row_to_cache("0"); cf.setMin_index_interval(128); cf.setMax_index_interval(2048); cf.setComment(""); cf.setColumn_metadata(ImmutableList.of()); cf.setMin_compaction_threshold(4); cf.setMax_compaction_threshold(32); cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType"); cf.setCompaction_strategy_options(ImmutableMap.of()); cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType"); return cf; }
static CfDef getStandardCfDef(String keyspace, String internalTableName) { CfDef cf = new CfDef(keyspace, internalTableName); cf.setComparator_type("CompositeType(BytesType,LongType)"); cf.setCompaction_strategy("LeveledCompactionStrategy"); cf.setCompaction_strategy_options(ImmutableMap.of("sstable_size_in_mb", CassandraConstants.SSTABLE_SIZE_IN_MB)); cf.setCompression_options(Maps.<String, String>newHashMap()); cf.setGc_grace_seconds(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; } }
/** * 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(ImmutableList.of()); cf.setCells_per_row_to_cache("0"); cf.setMin_index_interval(128); cf.setMax_index_interval(2048); cf.setComment(""); cf.setColumn_metadata(ImmutableList.of()); cf.setMin_compaction_threshold(4); cf.setMax_compaction_threshold(32); cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType"); cf.setCompaction_strategy_options(ImmutableMap.of()); cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType"); return cf; }
break; case CELLS_PER_ROW_TO_CACHE: cfDef.setCells_per_row_to_cache(CliUtils.unescapeSQLString(mValue)); break; case DEFAULT_TIME_TO_LIVE:
def.setMemtable_flush_period_in_ms(memtableFlushPeriod); def.setCaching(caching.toThriftCaching()); def.setCells_per_row_to_cache(caching.toThriftCellsPerRow()); def.setDefault_time_to_live(defaultTimeToLive); def.setSpeculative_retry(speculativeRetry.toString());
def.setMemtable_flush_period_in_ms(cfm.params.memtableFlushPeriodInMs); def.setCaching(toThrift(cfm.params.caching)); def.setCells_per_row_to_cache(toThriftCellsPerRow(cfm.params.caching)); def.setDefault_time_to_live(cfm.params.defaultTimeToLive); def.setSpeculative_retry(cfm.params.speculativeRetry.toString());
def.setMemtable_flush_period_in_ms(cfm.params.memtableFlushPeriodInMs); def.setCaching(toThrift(cfm.params.caching)); def.setCells_per_row_to_cache(toThriftCellsPerRow(cfm.params.caching)); def.setDefault_time_to_live(cfm.params.defaultTimeToLive); def.setSpeculative_retry(cfm.params.speculativeRetry.toString());
unsetCells_per_row_to_cache(); } else { setCells_per_row_to_cache((String)value);
unsetCells_per_row_to_cache(); } else { setCells_per_row_to_cache((String)value);
unsetCells_per_row_to_cache(); } else { setCells_per_row_to_cache((String)value);