cfDef.setMax_compaction_threshold(Integer.parseInt(maxCompactionThreshold));
@Override public ColumnFamilyDefinition setMaxCompactionThreshold(Integer value) { if (value != null) cfDef.setMax_compaction_threshold(value); return this; }
/** * 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; }
@Override public ColumnFamilyDefinition setMaxCompactionThreshold(Integer value) { if (value != null) cfDef.setMax_compaction_threshold(value); return this; }
d.setMax_compaction_threshold(maxCompactionThreshold); d.setMin_compaction_threshold(minCompactionThreshold); d.setRead_repair_chance(readRepairChance);
cfDef.setMax_compaction_threshold(Integer.parseInt(maxCompactionThreshold));
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; }
cf_def.setMin_compaction_threshold(CompactionParams.DEFAULT_MIN_THRESHOLD); if (!cf_def.isSetMax_compaction_threshold()) cf_def.setMax_compaction_threshold(CompactionParams.DEFAULT_MAX_THRESHOLD); if (!cf_def.isSetCompaction_strategy()) cf_def.setCompaction_strategy(CompactionParams.DEFAULT.klass().getSimpleName());
/** * Private helper to initialize a column family definition */ protected void initializeColumnFamilyDefinition() throws ClassNotFoundException { columnFamilyDefinition = new CfDef(); columnFamilyDefinition.setName(columnFamily); columnFamilyDefinition.setKeyspace(getKeySpace()); ColumnFamily cfAnnotation = target.getAnnotation(ColumnFamily.class); String comparatorType = cfAnnotation.compareWith().getName(); if (cfAnnotation.reversed()) { comparatorType = String.format("%s(reversed=true)", comparatorType); } columnFamilyDefinition.setComparator_type(comparatorType); columnFamilyDefinition.setKey_cache_size(cfAnnotation.keysCached()); columnFamilyDefinition.setRow_cache_size(cfAnnotation.rowsCached()); columnFamilyDefinition.setComment(StringUtils.defaultIfEmpty(cfAnnotation.comment(), null)); columnFamilyDefinition.setComparator_type(cfAnnotation.compareWith().getName()); columnFamilyDefinition.setRead_repair_chance(cfAnnotation.readRepairChance()); columnFamilyDefinition.setGc_grace_seconds(cfAnnotation.gcGraceSeconds()); columnFamilyDefinition.setDefault_validation_class(StringUtils.defaultIfEmpty(cfAnnotation.defaultValidationClass().getName(), null)); columnFamilyDefinition.setKey_validation_class(StringUtils.defaultIfEmpty(cfAnnotation.defaultKeyValidationClass().getName(), null)); columnFamilyDefinition.setMin_compaction_threshold(cfAnnotation.minCompactionThreshold()); columnFamilyDefinition.setMax_compaction_threshold(cfAnnotation.maxCompactionThreshold()); columnFamilyDefinition.setReplicate_on_write(cfAnnotation.replicateOnWrite()); }
if (threshold <= 0) throw new RuntimeException("Disabling compaction by setting min/max compaction thresholds to 0 has been deprecated, set compaction_strategy_options={'enabled':false} instead"); cfDef.setMax_compaction_threshold(Integer.parseInt(mValue)); cfDef.putToCompaction_strategy_options(CFPropDefs.KW_MAXCOMPACTIONTHRESHOLD, Integer.toString(threshold)); break;
cf_def.setMin_compaction_threshold(CompactionParams.DEFAULT_MIN_THRESHOLD); if (!cf_def.isSetMax_compaction_threshold()) cf_def.setMax_compaction_threshold(CompactionParams.DEFAULT_MAX_THRESHOLD); if (!cf_def.isSetCompaction_strategy()) cf_def.setCompaction_strategy(CompactionParams.DEFAULT.klass().getSimpleName());
cf_def.setMin_compaction_threshold(CFMetaData.DEFAULT_MIN_COMPACTION_THRESHOLD); if (!cf_def.isSetMax_compaction_threshold()) cf_def.setMax_compaction_threshold(CFMetaData.DEFAULT_MAX_COMPACTION_THRESHOLD); if (cf_def.compaction_strategy == null) cf_def.compaction_strategy = DEFAULT_COMPACTION_STRATEGY_CLASS.getSimpleName();
def.setKey_validation_class(keyValidator.toString()); def.setMin_compaction_threshold(minCompactionThreshold); def.setMax_compaction_threshold(maxCompactionThreshold);
def.setKey_validation_class(cfm.getKeyValidator().toString()); def.setMin_compaction_threshold(cfm.params.compaction.minCompactionThreshold()); def.setMax_compaction_threshold(cfm.params.compaction.maxCompactionThreshold());
def.setKey_validation_class(cfm.getKeyValidator().toString()); def.setMin_compaction_threshold(cfm.params.compaction.minCompactionThreshold()); def.setMax_compaction_threshold(cfm.params.compaction.maxCompactionThreshold());
d.setKey_cache_save_period_in_seconds(keyCacheSavePeriodInSeconds); d.setKey_validation_class(keyValidationClass); d.setMax_compaction_threshold(maxCompactionThreshold); d.setMin_compaction_threshold(minCompactionThreshold); d.setRead_repair_chance(readRepairChance);
d.setMax_compaction_threshold(maxCompactionThreshold); d.setMin_compaction_threshold(minCompactionThreshold); d.setRead_repair_chance(readRepairChance);
unsetMax_compaction_threshold(); } else { setMax_compaction_threshold((Integer)value);
unsetMax_compaction_threshold(); } else { setMax_compaction_threshold((Integer)value);