1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
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.
11 #include "rocksdb/env.h"
16 class VersionStorageInfo
;
21 // A helper class so we can efficiently apply a whole sequence
22 // of edits to a particular state without creating intermediate
23 // Versions that contain full copies of the intermediate state.
24 class VersionBuilder
{
26 VersionBuilder(const EnvOptions
& env_options
, TableCache
* table_cache
,
27 VersionStorageInfo
* base_vstorage
, Logger
* info_log
= nullptr);
29 void CheckConsistency(VersionStorageInfo
* vstorage
);
30 void CheckConsistencyForDeletes(VersionEdit
* edit
, uint64_t number
,
32 void Apply(VersionEdit
* edit
);
33 void SaveTo(VersionStorageInfo
* vstorage
);
34 void LoadTableHandlers(InternalStats
* internal_stats
, int max_threads
,
35 bool prefetch_index_and_filter_in_cache
);
36 void MaybeAddFile(VersionStorageInfo
* vstorage
, int level
, FileMetaData
* f
);
43 extern bool NewestFirstBySeqNo(FileMetaData
* a
, FileMetaData
* b
);
44 } // namespace rocksdb