mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 13:06:57 +00:00
row_marker: de-inline compact_and_expire()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user