diff --git a/sstables/mp_row_consumer.hh b/sstables/mp_row_consumer.hh index 6a9f48cfb6..a7d48059a1 100644 --- a/sstables/mp_row_consumer.hh +++ b/sstables/mp_row_consumer.hh @@ -1089,7 +1089,7 @@ public: if (maybe_push_range_tombstone(std::move(rt)) == proceed::no) { _in_progress_row.emplace(std::move(key)); - return consumer_m::retry_later{}; + return consumer_m::row_processing_result::retry_later; } } @@ -1098,19 +1098,19 @@ public: switch (_mf_filter->apply(_in_progress_row->position())) { case mutation_fragment_filter::result::emit: sstlog.trace("mp_row_consumer_m {}: emit", this); - return consumer_m::do_proceed{}; + return consumer_m::row_processing_result::do_proceed; case mutation_fragment_filter::result::ignore: sstlog.trace("mp_row_consumer_m {}: ignore", this); if (_mf_filter->is_current_range_changed()) { - return consumer_m::row_processing_result(consumer_m::retry_later{}); + return consumer_m::row_processing_result::retry_later; } else { _in_progress_row.reset(); - return consumer_m::row_processing_result(consumer_m::skip_row{}); + return consumer_m::row_processing_result::skip_row; } case mutation_fragment_filter::result::store_and_finish: sstlog.trace("mp_row_consumer_m {}: store_and_finish", this); _reader->on_end_of_stream(); - return consumer_m::retry_later{}; + return consumer_m::row_processing_result::retry_later; } abort(); } @@ -1131,7 +1131,7 @@ public: sstlog.trace("mp_row_consumer_m {}: consume_static_row_start()", this); _inside_static_row = true; _in_progress_static_row = static_row(); - return consumer_m::do_proceed{}; + return consumer_m::row_processing_result::do_proceed; } virtual proceed consume_column(const column_translation::column_info& column_info, diff --git a/sstables/row.hh b/sstables/row.hh index 6d6690b281..f81eea8df2 100644 --- a/sstables/row.hh +++ b/sstables/row.hh @@ -142,17 +142,17 @@ class consumer_m { public: using proceed = data_consumer::proceed; - // Causes the parser to return the control to the caller without advancing. - // Next time when the parser is called, the same consumer method will be called. - struct retry_later {}; + enum class row_processing_result { + // Causes the parser to return the control to the caller without advancing. + // Next time when the parser is called, the same consumer method will be called. + retry_later, - // Causes the parser to proceed to the next element. - struct do_proceed {}; + // Causes the parser to proceed to the next element. + do_proceed, - // Causes the parser to skip the whole row. consume_row_end() will not be called for the current row. - struct skip_row {}; - - using row_processing_result = std::variant; + // Causes the parser to skip the whole row. consume_row_end() will not be called for the current row. + skip_row + }; consumer_m(reader_resource_tracker resource_tracker, const io_priority_class& pc) : _resource_tracker(resource_tracker) @@ -945,10 +945,10 @@ private: ? _consumer.consume_static_row_start() : _consumer.consume_row_start(_row_key); - if (std::holds_alternative(ret)) { + if (ret == consumer_m::row_processing_result::retry_later) { _state = state::ROW_BODY_PREV_SIZE; return consumer_m::proceed::no; - } else if (std::holds_alternative(ret)) { + } else if (ret == consumer_m::row_processing_result::skip_row) { _state = state::FLAGS; auto current_pos = position() - data.size(); return skip(data, _next_row_offset - current_pos);