mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 17:10:35 +00:00
36 lines
1.4 KiB
C++
36 lines
1.4 KiB
C++
/*
|
|
* Copyright (C) 2014 Cloudius Systems, Ltd.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
|
|
#include "mutation_partition.hh"
|
|
#include "keys.hh"
|
|
#include "schema.hh"
|
|
|
|
class mutation final {
|
|
public:
|
|
schema_ptr schema;
|
|
partition_key key;
|
|
mutation_partition p;
|
|
public:
|
|
mutation(partition_key key_, schema_ptr schema_)
|
|
: schema(std::move(schema_))
|
|
, key(std::move(key_))
|
|
, p(schema)
|
|
{ }
|
|
mutation(mutation&&) = default;
|
|
mutation(const mutation&) = default;
|
|
void set_static_cell(const column_definition& def, atomic_cell_or_collection value);
|
|
void set_clustered_cell(const exploded_clustering_prefix& prefix, const column_definition& def, atomic_cell_or_collection value);
|
|
void set_clustered_cell(const clustering_key& key, const column_definition& def, atomic_cell_or_collection value);
|
|
void set_cell(const exploded_clustering_prefix& prefix, const bytes& name, const boost::any& value, api::timestamp_type timestamp, ttl_opt ttl = {});
|
|
void set_cell(const exploded_clustering_prefix& prefix, const column_definition& def, atomic_cell_or_collection value);
|
|
std::experimental::optional<atomic_cell_or_collection> get_cell(const clustering_key& rkey, const column_definition& def);
|
|
private:
|
|
static void update_column(row& row, const column_definition& def, atomic_cell_or_collection&& value);
|
|
friend std::ostream& operator<<(std::ostream& os, const mutation& m);
|
|
};
|