mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-08 07:53:20 +00:00
sstable: Add consumer_m::consume_row_marker_and_tombstone
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
@@ -35,6 +35,11 @@ class liveness_info {
|
|||||||
api::timestamp_type _timestamp;
|
api::timestamp_type _timestamp;
|
||||||
gc_clock::duration _ttl;
|
gc_clock::duration _ttl;
|
||||||
gc_clock::time_point _local_deletion_time;
|
gc_clock::time_point _local_deletion_time;
|
||||||
|
bool is_set() const {
|
||||||
|
return _timestamp != api::missing_timestamp
|
||||||
|
|| _ttl != gc_clock::duration::zero()
|
||||||
|
|| _local_deletion_time != gc_clock::time_point::max();
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
explicit liveness_info(const serialization_header& header)
|
explicit liveness_info(const serialization_header& header)
|
||||||
: _header(header)
|
: _header(header)
|
||||||
@@ -56,12 +61,10 @@ public:
|
|||||||
api::timestamp_type timestamp() const { return _timestamp; }
|
api::timestamp_type timestamp() const { return _timestamp; }
|
||||||
gc_clock::duration ttl() const { return _ttl; }
|
gc_clock::duration ttl() const { return _ttl; }
|
||||||
gc_clock::time_point local_deletion_time() const { return _local_deletion_time; }
|
gc_clock::time_point local_deletion_time() const { return _local_deletion_time; }
|
||||||
bool is_set() const {
|
|
||||||
return _timestamp != api::missing_timestamp
|
|
||||||
|| _ttl != gc_clock::duration::zero()
|
|
||||||
|| _local_deletion_time != gc_clock::time_point::max();
|
|
||||||
}
|
|
||||||
row_marker to_row_marker() const {
|
row_marker to_row_marker() const {
|
||||||
|
if (!is_set()) {
|
||||||
|
return row_marker();
|
||||||
|
}
|
||||||
return _ttl != gc_clock::duration::zero() || _local_deletion_time != gc_clock::time_point::max()
|
return _ttl != gc_clock::duration::zero() || _local_deletion_time != gc_clock::time_point::max()
|
||||||
? row_marker(_timestamp, _ttl, _local_deletion_time)
|
? row_marker(_timestamp, _ttl, _local_deletion_time)
|
||||||
: row_marker(_timestamp);
|
: row_marker(_timestamp);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "row.hh"
|
#include "row.hh"
|
||||||
#include "clustering_ranges_walker.hh"
|
#include "clustering_ranges_walker.hh"
|
||||||
#include "utils/data_input.hh"
|
#include "utils/data_input.hh"
|
||||||
|
#include "liveness_info.hh"
|
||||||
|
|
||||||
namespace sstables {
|
namespace sstables {
|
||||||
|
|
||||||
@@ -931,6 +932,12 @@ public:
|
|||||||
return proceed::yes;
|
return proceed::yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual proceed consume_row_marker_and_tombstone(const liveness_info& info, tombstone t) override {
|
||||||
|
_in_progress_row.apply(t);
|
||||||
|
_in_progress_row.apply(info.to_row_marker());
|
||||||
|
return proceed::yes;
|
||||||
|
}
|
||||||
|
|
||||||
virtual proceed consume_static_row_start() override {
|
virtual proceed consume_static_row_start() override {
|
||||||
_inside_static_row = true;
|
_inside_static_row = true;
|
||||||
_in_progress_static_row = static_row();
|
_in_progress_static_row = static_row();
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "column_translation.hh"
|
#include "column_translation.hh"
|
||||||
|
|
||||||
#include "sstables.hh"
|
#include "sstables.hh"
|
||||||
|
#include "tombstone.hh"
|
||||||
|
|
||||||
// sstables::data_consume_row feeds the contents of a single row into a
|
// sstables::data_consume_row feeds the contents of a single row into a
|
||||||
// row_consumer object:
|
// row_consumer object:
|
||||||
@@ -154,6 +155,8 @@ public:
|
|||||||
|
|
||||||
virtual proceed consume_row_start(const std::vector<temporary_buffer<char>>& ecp) = 0;
|
virtual proceed consume_row_start(const std::vector<temporary_buffer<char>>& ecp) = 0;
|
||||||
|
|
||||||
|
virtual proceed consume_row_marker_and_tombstone(const sstables::liveness_info& info, tombstone t) = 0;
|
||||||
|
|
||||||
virtual proceed consume_static_row_start() = 0;
|
virtual proceed consume_static_row_start() = 0;
|
||||||
|
|
||||||
virtual proceed consume_column(stdx::optional<column_id> column_id,
|
virtual proceed consume_column(stdx::optional<column_id> column_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user