cfDef.setDclocal_read_repair_chance(Double.parseDouble(dclocalReadRepairChance));
/** * 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 setLocalReadRepairChance(Double value) { if (value != null) cfDef.setDclocal_read_repair_chance(value); return this; }
@Override public ColumnFamilyDefinition setLocalReadRepairChance(Double value) { if (value != null) cfDef.setDclocal_read_repair_chance(value); return this; }
private void onSetReadRepairChance(CfDef cfDef, Properties cFProperties, StringBuilder builder) { String dclocalReadRepairChance = cFProperties.getProperty(CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE); if (dclocalReadRepairChance != null) { try { if (builder != null) { appendPropertyToBuilder(builder, dclocalReadRepairChance, CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE); } else { cfDef.setDclocal_read_repair_chance(Double.parseDouble(dclocalReadRepairChance)); } } catch (NumberFormatException nfe) { log.error("READ_REPAIR_CHANCE should be double type, Caused by: .", nfe); throw new SchemaGenerationException(nfe); } } }
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.setDefault_time_to_live(TableParams.DEFAULT_DEFAULT_TIME_TO_LIVE); if (!cf_def.isSetDclocal_read_repair_chance()) cf_def.setDclocal_read_repair_chance(TableParams.DEFAULT_DCLOCAL_READ_REPAIR_CHANCE);
cf_def.setDefault_time_to_live(TableParams.DEFAULT_DEFAULT_TIME_TO_LIVE); if (!cf_def.isSetDclocal_read_repair_chance()) cf_def.setDclocal_read_repair_chance(TableParams.DEFAULT_DCLOCAL_READ_REPAIR_CHANCE);
throw new RuntimeException("Error: dclocal_read_repair_chance must be between 0 and 1."); cfDef.setDclocal_read_repair_chance(localChance); break; case GC_GRACE:
cf_def.setDefault_time_to_live(CFMetaData.DEFAULT_DEFAULT_TIME_TO_LIVE); if (!cf_def.isSetDclocal_read_repair_chance()) cf_def.setDclocal_read_repair_chance(CFMetaData.DEFAULT_DCLOCAL_READ_REPAIR_CHANCE);
def.setDclocal_read_repair_chance(dcLocalReadRepairChance); def.setGc_grace_seconds(gcGraceSeconds); def.setDefault_validation_class(defaultValidator == null ? null : defaultValidator.toString());
def.setDclocal_read_repair_chance(cfm.params.dcLocalReadRepairChance); def.setGc_grace_seconds(cfm.params.gcGraceSeconds); def.setDefault_validation_class(cfm.makeLegacyDefaultValidator().toString());
def.setDclocal_read_repair_chance(cfm.params.dcLocalReadRepairChance); def.setGc_grace_seconds(cfm.params.gcGraceSeconds); def.setDefault_validation_class(cfm.makeLegacyDefaultValidator().toString());
unsetDclocal_read_repair_chance(); } else { setDclocal_read_repair_chance((Double)value);
unsetDclocal_read_repair_chance(); } else { setDclocal_read_repair_chance((Double)value);
unsetDclocal_read_repair_chance(); } else { setDclocal_read_repair_chance((Double)value);