ClickHouse/dbms/Storages/MergeTree/LevelMergeSelector.h
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

31 lines
590 B
C++

#pragma once
#include <Storages/MergeTree/MergeSelector.h>
namespace DB
{
/** Select parts to merge based on its level.
* Select first range of parts of parts_to_merge length with minimum level.
*/
class LevelMergeSelector : public IMergeSelector
{
public:
struct Settings
{
size_t parts_to_merge = 10;
};
explicit LevelMergeSelector(const Settings & settings_) : settings(settings_) {}
PartsInPartition select(
const Partitions & partitions,
const size_t max_total_size_to_merge) override;
private:
const Settings settings;
};
}