mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 10:30:38 +00:00
Following what happened to others: we can now include memtable.hh without including database.hh Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
28 lines
925 B
C++
28 lines
925 B
C++
#pragma once
|
|
#include <map>
|
|
#include <memory>
|
|
#include "database_fwd.hh"
|
|
#include "dht/i_partitioner.hh"
|
|
#include "schema.hh"
|
|
|
|
class frozen_mutation;
|
|
|
|
class memtable {
|
|
public:
|
|
using partitions_type = std::map<dht::decorated_key, mutation_partition, dht::decorated_key::less_comparator>;
|
|
private:
|
|
schema_ptr _schema;
|
|
partitions_type partitions;
|
|
public:
|
|
using const_mutation_partition_ptr = std::unique_ptr<const mutation_partition>;
|
|
public:
|
|
explicit memtable(schema_ptr schema);
|
|
schema_ptr schema() const { return _schema; }
|
|
mutation_partition& find_or_create_partition(const dht::decorated_key& key);
|
|
mutation_partition& find_or_create_partition_slow(partition_key_view key);
|
|
const_mutation_partition_ptr find_partition(const dht::decorated_key& key) const;
|
|
void apply(const mutation& m);
|
|
void apply(const frozen_mutation& m);
|
|
const partitions_type& all_partitions() const;
|
|
};
|