row_marker: de-inline compact_and_expire()

This commit is contained in:
Botond Dénes
2019-07-04 17:14:54 +03:00
parent 4c7a7ffe8f
commit 7db2006162
2 changed files with 20 additions and 17 deletions

View File

@@ -1763,6 +1763,25 @@ row row::difference(const schema& s, column_kind kind, const row& other) const
return r;
}
bool row_marker::compact_and_expire(tombstone tomb, gc_clock::time_point now,
can_gc_fn& can_gc, gc_clock::time_point gc_before) {
if (is_missing()) {
return false;
}
if (_timestamp <= tomb.timestamp) {
_timestamp = api::missing_timestamp;
return false;
}
if (_ttl > no_ttl && _expiry < now) {
_expiry -= _ttl;
_ttl = dead;
}
if (_ttl == dead && _expiry < gc_before && can_gc(tombstone(_timestamp, _expiry))) {
_timestamp = api::missing_timestamp;
}
return !is_missing() && _ttl != dead;
}
mutation_partition mutation_partition::difference(schema_ptr s, const mutation_partition& other) const
{
mutation_partition mp(s);

View File

@@ -443,23 +443,7 @@ public:
// tombstones.
// Returns true if row marker is live.
bool compact_and_expire(tombstone tomb, gc_clock::time_point now,
can_gc_fn& can_gc, gc_clock::time_point gc_before) {
if (is_missing()) {
return false;
}
if (_timestamp <= tomb.timestamp) {
_timestamp = api::missing_timestamp;
return false;
}
if (_ttl > no_ttl && _expiry < now) {
_expiry -= _ttl;
_ttl = dead;
}
if (_ttl == dead && _expiry < gc_before && can_gc(tombstone(_timestamp, _expiry))) {
_timestamp = api::missing_timestamp;
}
return !is_missing() && _ttl != dead;
}
can_gc_fn& can_gc, gc_clock::time_point gc_before);
// Consistent with feed_hash()
bool operator==(const row_marker& other) const {
if (_timestamp != other._timestamp) {