Skip to content

Commit

Permalink
schema: add local_repair_chance parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
  • Loading branch information
glommer committed Jul 10, 2015
1 parent 8218c81 commit b75bd9e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cql3/statements/cf_prop_defs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ public:
}
#if 0
cfm.readRepairChance(getDouble(KW_READREPAIRCHANCE, cfm.getReadRepairChance()));
cfm.dcLocalReadRepairChance(getDouble(KW_DCLOCALREADREPAIRCHANCE, cfm.getDcLocalReadRepairChance()));
#endif
if (has_property(KW_DCLOCALREADREPAIRCHANCE)) {
builder.set_dc_local_read_repair_chance(get_double(KW_DCLOCALREADREPAIRCHANCE, builder.get_dc_local_read_repair_chance()));
}

if (has_property(KW_GCGRACESECONDS)) {
builder.set_gc_grace_seconds(get_int(KW_GCGRACESECONDS, builder.get_gc_grace_seconds()));
}
Expand Down
7 changes: 5 additions & 2 deletions db/legacy_schema_tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,8 @@ future<> save_system_keyspace_schema() {
m.set_clustered_cell(ckey, "default_validator", table->default_validator()->name(), timestamp);
m.set_clustered_cell(ckey, "gc_grace_seconds", table->gc_grace_seconds(), timestamp);
m.set_clustered_cell(ckey, "key_validator", table->thrift_key_validator(), timestamp);
m.set_clustered_cell(ckey, "local_read_repair_chance", table->dc_local_read_repair_chance(), timestamp);
#if 0
adder.add("local_read_repair_chance", table.getDcLocalReadRepairChance());
adder.add("max_compaction_threshold", table.getMaxCompactionThreshold());
adder.add("max_index_interval", table.getMaxIndexInterval());
adder.add("memtable_flush_period_in_ms", table.getMemtableFlushPeriod());
Expand Down Expand Up @@ -1260,8 +1260,11 @@ future<> save_system_keyspace_schema() {

#if 0
cfm.readRepairChance(result.getDouble("read_repair_chance"));
cfm.dcLocalReadRepairChance(result.getDouble("local_read_repair_chance"));
#endif
if (table_row.has("local_read_repair_chance")) {
builder.set_dc_local_read_repair_chance(table_row.get_nonnull<double>("local_read_repair_chance"));
}

if (table_row.has("gc_grace_seconds")) {
builder.set_gc_grace_seconds(table_row.get_nonnull<int32_t>("gc_grace_seconds"));
}
Expand Down
5 changes: 5 additions & 0 deletions schema.hh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ private:
bool _is_dense = false;
cf_type _type = cf_type::standard;
int32_t _gc_grace_seconds = 864000;
double _dc_local_read_repair_chance = 0.1;
};
raw_schema _raw;
thrift_schema _thrift;
Expand Down Expand Up @@ -273,6 +274,10 @@ public:
return _raw._gc_grace_seconds;
}

double dc_local_read_repair_chance() const {
return _raw._dc_local_read_repair_chance;
}

const column_definition* get_column_definition(const bytes& name) const;
const_iterator regular_begin() const {
return regular_columns().begin();
Expand Down
8 changes: 8 additions & 0 deletions schema_builder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public:
return _raw._gc_grace_seconds;
}

void set_dc_local_read_repair_chance(double chance) {
_raw._dc_local_read_repair_chance = chance;
}

double get_dc_local_read_repair_chance() {
return _raw._dc_local_read_repair_chance;
}

void set_bloom_filter_fp_chance(double fp) {
_raw._bloom_filter_fp_chance = fp;
}
Expand Down

0 comments on commit b75bd9e

Please sign in to comment.