mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
31 lines
587 B
C++
31 lines
587 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_) {}
|
|
|
|
PartsRange select(
|
|
const PartsRanges & parts_ranges,
|
|
const size_t max_total_size_to_merge) override;
|
|
|
|
private:
|
|
const Settings settings;
|
|
};
|
|
|
|
}
|