Skip to content

Commit

Permalink
schema: memtable flush period
Browse files Browse the repository at this point in the history
currently set to 0, which is Origin's default

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
  • Loading branch information
glommer committed Jul 29, 2015
1 parent dce642f commit 01e5fca
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 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 @@ -202,8 +202,11 @@ public:
#if 0
cfm.defaultTimeToLive(getInt(KW_DEFAULT_TIME_TO_LIVE, cfm.getDefaultTimeToLive()));
cfm.speculativeRetry(CFMetaData.SpeculativeRetry.fromString(getString(KW_SPECULATIVE_RETRY, cfm.getSpeculativeRetry().toString())));
cfm.memtableFlushPeriod(getInt(KW_MEMTABLE_FLUSH_PERIOD, cfm.getMemtableFlushPeriod()));
#endif
if (has_property(KW_MEMTABLE_FLUSH_PERIOD)) {
builder.set_memtable_flush_period(get_int(KW_MEMTABLE_FLUSH_PERIOD, builder.get_memtable_flush_period()));
}

if (has_property(KW_MIN_INDEX_INTERVAL)) {
builder.set_min_index_interval(get_int(KW_MIN_INDEX_INTERVAL, builder.get_min_index_interval()));
}
Expand Down
11 changes: 6 additions & 5 deletions db/legacy_schema_tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1066,9 +1066,7 @@ future<> save_system_keyspace_schema() {
m.set_clustered_cell(ckey, "max_compaction_threshold", table->max_compaction_threshold(), timestamp);
m.set_clustered_cell(ckey, "min_index_interval", table->min_index_interval(), timestamp);
m.set_clustered_cell(ckey, "max_index_interval", table->max_index_interval(), timestamp);
#if 0
adder.add("memtable_flush_period_in_ms", table.getMemtableFlushPeriod());
#endif
m.set_clustered_cell(ckey, "memtable_flush_period_in_ms", table->memtable_flush_period(), timestamp);
m.set_clustered_cell(ckey, "read_repair_chance", table->read_repair_chance(), timestamp);
#if 0
adder.add("speculative_retry", table.getSpeculativeRetry().toString());
Expand Down Expand Up @@ -1319,8 +1317,11 @@ future<> save_system_keyspace_schema() {
#if 0
if (result.has("comment"))
cfm.comment(result.getString("comment"));
if (result.has("memtable_flush_period_in_ms"))
cfm.memtableFlushPeriod(result.getInt("memtable_flush_period_in_ms"));
#endif
if (table_row.has("memtable_flush_period_in_ms")) {
builder.set_memtable_flush_period(table_row.get_nonnull<int32_t>("memtable_flush_period_in_ms"));
}
#if 0
cfm.caching(CachingOptions.fromString(result.getString("caching")));
if (result.has("default_time_to_live"))
cfm.defaultTimeToLive(result.getInt("default_time_to_live"));
Expand Down
5 changes: 5 additions & 0 deletions schema.hh
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ private:
int32_t _max_compaction_threshold = DEFAULT_MAX_COMPACTION_THRESHOLD;
int32_t _min_index_interval = 128;
int32_t _max_index_interval = 2048;
int32_t _memtable_flush_period = 0;
// FIXME: SizeTiered doesn't really work yet. Being it marked here only means that this is the strategy
// we will use by default - when we have the choice.
sstables::compaction_strategy_type _compaction_strategy = sstables::compaction_strategy_type::size_tiered;
Expand Down Expand Up @@ -311,6 +312,10 @@ public:
return _raw._max_index_interval;
}

int32_t memtable_flush_period() const {
return _raw._memtable_flush_period;
}

sstables::compaction_strategy_type compaction_strategy() const {
return _raw._compaction_strategy;
}
Expand Down
8 changes: 8 additions & 0 deletions schema_builder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ public:
return _raw._max_index_interval;
}

void set_memtable_flush_period(int32_t t) {
_raw._memtable_flush_period = t;
}

int32_t get_memtable_flush_period() const {
return _raw._memtable_flush_period;
}

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

0 comments on commit 01e5fca

Please sign in to comment.