Skip to content

Commit

Permalink
schema: read_repair_chance
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 ea17f6d commit fe370ec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
8 changes: 5 additions & 3 deletions cql3/statements/cf_prop_defs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ public:
if (has_property(KW_COMMENT)) {
builder.set_comment(get_string(KW_COMMENT, ""));
}
#if 0
cfm.readRepairChance(getDouble(KW_READREPAIRCHANCE, cfm.getReadRepairChance()));
#endif

if (has_property(KW_READREPAIRCHANCE)) {
builder.set_read_repair_chance(get_double(KW_READREPAIRCHANCE, builder.get_read_repair_chance()));
}

if (has_property(KW_DCLOCALREADREPAIRCHANCE)) {
builder.set_dc_local_read_repair_chance(get_double(KW_DCLOCALREADREPAIRCHANCE, builder.get_dc_local_read_repair_chance()));
}
Expand Down
11 changes: 7 additions & 4 deletions db/legacy_schema_tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,9 @@ future<> save_system_keyspace_schema() {
m.set_clustered_cell(ckey, "max_index_interval", table->max_index_interval(), timestamp);
#if 0
adder.add("memtable_flush_period_in_ms", table.getMemtableFlushPeriod());
adder.add("read_repair_chance", table.getReadRepairChance());
#endif
m.set_clustered_cell(ckey, "read_repair_chance", table->read_repair_chance(), timestamp);
#if 0
adder.add("speculative_retry", table.getSpeculativeRetry().toString());

for (Map.Entry<ColumnIdentifier, Long> entry : table.getDroppedColumns().entrySet())
Expand Down Expand Up @@ -1258,9 +1260,10 @@ future<> save_system_keyspace_schema() {
#endif
builder.set_is_dense(is_dense);

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

if (table_row.has("local_read_repair_chance")) {
builder.set_dc_local_read_repair_chance(table_row.get_nonnull<double>("local_read_repair_chance"));
}
Expand Down
5 changes: 5 additions & 0 deletions schema.hh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private:
cf_type _type = cf_type::standard;
int32_t _gc_grace_seconds = 864000;
double _dc_local_read_repair_chance = 0.1;
double _read_repair_chance = 0.0;
int32_t _min_compaction_threshold = 4;
int32_t _max_compaction_threshold = 32;
int32_t _min_index_interval = 128;
Expand Down Expand Up @@ -282,6 +283,10 @@ public:
return _raw._dc_local_read_repair_chance;
}

double read_repair_chance() const {
return _raw._read_repair_chance;
}

int32_t min_compaction_threshold() const {
return _raw._min_compaction_threshold;
}
Expand Down
8 changes: 8 additions & 0 deletions schema_builder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public:
return _raw._dc_local_read_repair_chance;
}

void set_read_repair_chance(double chance) {
_raw._read_repair_chance = chance;
}

double get_read_repair_chance() {
return _raw._read_repair_chance;
}

void set_min_compaction_threshold(int32_t t) {
_raw._min_compaction_threshold = t;
}
Expand Down

0 comments on commit fe370ec

Please sign in to comment.