MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
ob_compaction_picker.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11#pragma once
12
13#include "oblsm/table/ob_sstable.h"
14#include "common/sys/rc.h"
15#include "oblsm/compaction/ob_compaction.h"
16#include "oblsm/util/ob_comparator.h"
17
18namespace oceanbase {
19
28{
29public:
34
35 virtual ~ObCompactionPicker() = default;
36
42 virtual unique_ptr<ObCompaction> pick(SSTablesPtr sstables) = 0;
43
50 static ObCompactionPicker *create(CompactionType type, ObLsmOptions *options);
51
52protected:
54};
55
62{
63public:
68
69 ~TiredCompactionPicker() = default;
70
74 unique_ptr<ObCompaction> pick(SSTablesPtr sstables) override;
75
76private:
77};
78
79} // namespace oceanbase
Abstract base class for compaction picker strategies in an LSM-Tree.
Definition: ob_compaction_picker.h:28
ObLsmOptions * options_
Pointer to the LSM-Tree options configuration.
Definition: ob_compaction_picker.h:53
static ObCompactionPicker * create(CompactionType type, ObLsmOptions *options)
Static factory method to create a specific compaction picker.
Definition: ob_compaction_picker.cpp:34
ObCompactionPicker(ObLsmOptions *options)
Definition: ob_compaction_picker.h:33
virtual unique_ptr< ObCompaction > pick(SSTablesPtr sstables)=0
Pure virtual method to pick a compaction task.
A class implementing the tiered compaction strategy.
Definition: ob_compaction_picker.h:62
TiredCompactionPicker(ObLsmOptions *options)
Definition: ob_compaction_picker.h:67
unique_ptr< ObCompaction > pick(SSTablesPtr sstables) override
Implementation of the pick method for tiered compaction.
Definition: ob_compaction_picker.cpp:17
Configuration options for the LSM-Tree implementation.
Definition: ob_lsm_options.h:22