]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/db/version_builder.h
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / db / version_builder.h
CommitLineData
7c673cae 1// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
11fdf7f2
TL
2// This source code is licensed under both the GPLv2 (found in the
3// COPYING file in the root directory) and Apache 2.0 License
4// (found in the LICENSE.Apache file in the root directory).
7c673cae
FG
5//
6// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7// Use of this source code is governed by a BSD-style license that can be
8// found in the LICENSE file. See the AUTHORS file for names of contributors.
9//
10#pragma once
11#include "rocksdb/env.h"
11fdf7f2 12#include "rocksdb/slice_transform.h"
7c673cae
FG
13
14namespace rocksdb {
15
16class TableCache;
17class VersionStorageInfo;
18class VersionEdit;
19struct FileMetaData;
20class InternalStats;
21
22// A helper class so we can efficiently apply a whole sequence
23// of edits to a particular state without creating intermediate
24// Versions that contain full copies of the intermediate state.
25class VersionBuilder {
26 public:
27 VersionBuilder(const EnvOptions& env_options, TableCache* table_cache,
28 VersionStorageInfo* base_vstorage, Logger* info_log = nullptr);
29 ~VersionBuilder();
30 void CheckConsistency(VersionStorageInfo* vstorage);
31 void CheckConsistencyForDeletes(VersionEdit* edit, uint64_t number,
32 int level);
11fdf7f2 33 bool CheckConsistencyForNumLevels();
7c673cae
FG
34 void Apply(VersionEdit* edit);
35 void SaveTo(VersionStorageInfo* vstorage);
494da23a
TL
36 Status LoadTableHandlers(InternalStats* internal_stats, int max_threads,
37 bool prefetch_index_and_filter_in_cache,
38 bool is_initial_load,
39 const SliceTransform* prefix_extractor);
7c673cae
FG
40 void MaybeAddFile(VersionStorageInfo* vstorage, int level, FileMetaData* f);
41
42 private:
43 class Rep;
44 Rep* rep_;
45};
46
47extern bool NewestFirstBySeqNo(FileMetaData* a, FileMetaData* b);
48} // namespace rocksdb