Size-tired strategy basically consists of creating buckets with sstables of nearly the same size. Afterwards, it will find the most interesting bucket, which size must be between min threshold and max threshold. Bucket with the smallest average size is the most interesting one. Bucket hotness is also considered when finding the most interesting bucket, but we don't support this yet. We are also missing some code that discards sstable based on its coldness, i.e. hardly read. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
38 lines
873 B
C++
38 lines
873 B
C++
/*
|
|
* Copyright 2015 Cloudius Systems
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
class column_family;
|
|
|
|
namespace sstables {
|
|
|
|
enum class compaction_strategy_type {
|
|
null,
|
|
major,
|
|
size_tiered,
|
|
// FIXME: Add support to LevelTiered, and DateTiered.
|
|
};
|
|
|
|
class compaction_strategy_impl;
|
|
|
|
class compaction_strategy {
|
|
::shared_ptr<compaction_strategy_impl> _compaction_strategy_impl;
|
|
public:
|
|
compaction_strategy(::shared_ptr<compaction_strategy_impl> impl);
|
|
|
|
compaction_strategy();
|
|
~compaction_strategy();
|
|
compaction_strategy(const compaction_strategy&);
|
|
compaction_strategy(compaction_strategy&&);
|
|
compaction_strategy& operator=(compaction_strategy&&);
|
|
|
|
future<> compact(column_family& cfs);
|
|
};
|
|
|
|
// Creates a compaction_strategy object from one of the strategies available.
|
|
compaction_strategy make_compaction_strategy(compaction_strategy_type strategy);
|
|
|
|
}
|