-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathmutation_partition_view.hh
73 lines (64 loc) · 2.51 KB
/
mutation_partition_view.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (C) 2015 ScyllaDB
*/
/*
* This file is part of Scylla.
*
* Scylla is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Scylla is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Scylla. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "database_fwd.hh"
#include "mutation_partition_visitor.hh"
#include "utils/input_stream.hh"
namespace ser {
class mutation_partition_view;
}
class partition_builder;
class converting_mutation_partition_applier;
GCC6_CONCEPT(
template<typename T>
concept bool MutationViewVisitor = requires (T visitor, tombstone t, atomic_cell ac,
collection_mutation_view cmv, range_tombstone rt,
position_in_partition_view pipv, row_tombstone row_tomb,
row_marker rm) {
visitor.accept_partition_tombstone(t);
visitor.accept_static_cell(column_id(), std::move(ac));
visitor.accept_static_cell(column_id(), cmv);
visitor.accept_row_tombstone(rt);
visitor.accept_row(pipv, row_tomb, rm,
is_dummy::no, is_continuous::yes);
visitor.accept_row_cell(column_id(), std::move(ac));
visitor.accept_row_cell(column_id(), cmv);
};
)
// View on serialized mutation partition. See mutation_partition_serializer.
class mutation_partition_view {
utils::input_stream _in;
private:
mutation_partition_view(utils::input_stream v)
: _in(v)
{ }
template<typename Visitor>
GCC6_CONCEPT(requires MutationViewVisitor<Visitor>)
void do_accept(const column_mapping&, Visitor& visitor) const;
public:
static mutation_partition_view from_stream(utils::input_stream v) {
return { v };
}
static mutation_partition_view from_view(ser::mutation_partition_view v);
void accept(const schema& schema, partition_builder& visitor) const;
void accept(const column_mapping&, converting_mutation_partition_applier& visitor) const;
std::optional<clustering_key> first_row_key() const;
std::optional<clustering_key> last_row_key() const;
};