mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-30 13:17:01 +00:00
As requested in #22104, moved the files and fixed other includes and build system. Moved files: - combine.hh - collection_mutation.hh - collection_mutation.cc - converting_mutation_partition_applier.hh - converting_mutation_partition_applier.cc - counters.hh - counters.cc - timestamp.hh Fixes: #22104 This is a cleanup, no need to backport Closes scylladb/scylladb#25085
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2018-present ScyllaDB
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "mutation/timestamp.hh"
|
|
#include "gc_clock.hh"
|
|
#include "sstables/types.hh"
|
|
#include "mutation/mutation_partition.hh"
|
|
|
|
namespace sstables {
|
|
|
|
struct liveness_info {
|
|
api::timestamp_type _timestamp = api::missing_timestamp;
|
|
gc_clock::duration _ttl = gc_clock::duration::zero();
|
|
gc_clock::time_point _local_deletion_time = gc_clock::time_point::max();
|
|
bool is_set() const {
|
|
return _timestamp != api::missing_timestamp
|
|
|| _ttl != gc_clock::duration::zero()
|
|
|| _local_deletion_time != gc_clock::time_point::max();
|
|
}
|
|
public:
|
|
void set_timestamp(api::timestamp_type timestamp) {
|
|
_timestamp = timestamp;
|
|
}
|
|
void set_ttl(gc_clock::duration ttl) {
|
|
_ttl = ttl;
|
|
}
|
|
void set_local_deletion_time(gc_clock::time_point local_deletion_time) {
|
|
_local_deletion_time = local_deletion_time;
|
|
}
|
|
api::timestamp_type timestamp() const { return _timestamp; }
|
|
gc_clock::duration ttl() const { return _ttl; }
|
|
gc_clock::time_point local_deletion_time() const { return _local_deletion_time; }
|
|
row_marker to_row_marker() const {
|
|
if (!is_set()) {
|
|
return row_marker();
|
|
}
|
|
if (is_expired_liveness_ttl(_ttl)) {
|
|
return row_marker{tombstone{_timestamp, _local_deletion_time}};
|
|
} else if (_ttl != gc_clock::duration::zero() || _local_deletion_time != gc_clock::time_point::max()) {
|
|
return row_marker{_timestamp, _ttl, _local_deletion_time};
|
|
}
|
|
|
|
return row_marker{_timestamp};
|
|
}
|
|
};
|
|
|
|
}
|