column_family: do not open code generation calculation

We already have a function that wraps this, re-use it.  This FIXME is still
relevant, so just move it there. Let's not lose it.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
(cherry picked from commit 94e90d4a17)
This commit is contained in:
Glauber Costa
2016-03-01 15:01:40 -05:00
committed by Pekka Enberg
parent 3f67277804
commit e885eacbe4
2 changed files with 3 additions and 3 deletions

View File

@@ -589,9 +589,7 @@ column_family::seal_active_memtable() {
future<stop_iteration>
column_family::try_flush_memtable_to_sstable(lw_shared_ptr<memtable> old) {
// FIXME: better way of ensuring we don't attempt to
// overwrite an existing table.
auto gen = _sstable_generation++ * smp::count + engine().cpu_id();
auto gen = calculate_generation_for_new_table();
auto newtab = make_lw_shared<sstables::sstable>(_schema->ks_name(), _schema->cf_name(),
_config.datadir, gen,

View File

@@ -189,6 +189,8 @@ private:
}
uint64_t calculate_generation_for_new_table() {
// FIXME: better way of ensuring we don't attempt to
// overwrite an existing table.
return _sstable_generation++ * smp::count + engine().cpu_id();
}