Files
scylladb/mutation_partition_visitor.hh
Tomasz Grabiec 4ab66de0ae db: Introduce frozen_mutation
The immediate motivation for introducing frozen_mutation is inability
to deserialize current "mutation" object, which needs schema reference
at the time it's constructed. It needs schema to initialize its
internal maps with proper key comparators, which depend on schema.

frozen_mutation is an immutable, compact form of a mutation. It
doesn't use complex in-memory strucutres, data is stored in a linear
buffer. In case of frozen_mutation schema needs to be supplied only at
the time mutation partition is visited. Therefore it can be trivially
deserialized without schema.
2015-05-08 09:19:01 +02:00

44 lines
1.3 KiB
C++

/*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
#pragma once
#include "atomic_cell.hh"
#include "tombstone.hh"
#include "keys.hh"
// Guarantees:
//
// - any tombstones which affect cell's liveness are visited before that cell
//
// - rows are visited in ascending order with respect to their keys
//
// - row header (accept_row) is visited before that row's cells
//
// - row tombstones are visited in ascending order with respect to their key prefixes
//
// - cells in given row are visited in ascending order with respect to their column IDs
//
// - static row is visited before any clustered row
//
// - for each column in a row only one variant of accept_(static|row)_cell() is called, appropriate
// for column's kind (atomic or collection).
//
class mutation_partition_visitor {
public:
virtual void accept_partition_tombstone(tombstone) = 0;
virtual void accept_static_cell(column_id, atomic_cell_view) = 0;
virtual void accept_static_cell(column_id, collection_mutation::view) = 0;
virtual void accept_row_tombstone(clustering_key_prefix_view, tombstone) = 0;
virtual void accept_row(clustering_key_view key, api::timestamp_type created_at, tombstone deleted_at) = 0;
virtual void accept_row_cell(column_id id, atomic_cell_view) = 0;
virtual void accept_row_cell(column_id id, collection_mutation::view) = 0;
};