Files
scylladb/sstables/compaction.hh
Nadav Har'El f26dae3bf9 sstable: basic compaction function
This patch adds the basic compaction function sstables::compact_sstables,
which takes a list of input sstables, and creates several (currently one)
merged sstable. This implementation is pretty simple once we have all
the infrastructure in place (combining reader, writer, and a pipe between
them to reduce context switches).

This is already working compaction, but not quite complete: We'll need
to add compaction strategies (which sstables to compact, and when),
better cardinality estimator, sstable management and renaming, and a lot
of other details, and we'll probably still need to change the API.
But we can already write a test for compacting existing sstables (see
the next patch), and I wanted to get this patch out of the way, so we can
start working on applying compaction in a real use case.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-23 09:48:58 +03:00

24 lines
552 B
C++

/*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*
*/
#pragma once
#include "sstables.hh"
namespace sstables {
class sstable_creator {
public:
// new_tmp() creates a new sstable, which is marked temporary
// until all temporary sstables are finalized with commit().
virtual shared_sstable new_tmp() = 0;
virtual void commit() = 0;
virtual ~sstable_creator() { };
};
future<> compact_sstables(std::vector<shared_sstable> sstables,
schema_ptr schema, sstable_creator& creator);
}