]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/include/rocksdb/utilities/checkpoint.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / include / rocksdb / utilities / checkpoint.h
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.
5 //
6 // A checkpoint is an openable snapshot of a database at a point in time.
7
8 #pragma once
9 #ifndef ROCKSDB_LITE
10
11 #include <string>
12 #include "rocksdb/status.h"
13
14 namespace rocksdb {
15
16 class DB;
17
18 class Checkpoint {
19 public:
20 // Creates a Checkpoint object to be used for creating openable sbapshots
21 static Status Create(DB* db, Checkpoint** checkpoint_ptr);
22
23 // Builds an openable snapshot of RocksDB on the same disk, which
24 // accepts an output directory on the same disk, and under the directory
25 // (1) hard-linked SST files pointing to existing live SST files
26 // SST files will be copied if output directory is on a different filesystem
27 // (2) a copied manifest files and other files
28 // The directory should not already exist and will be created by this API.
29 // The directory will be an absolute path
30 // log_size_for_flush: if the total log file size is equal or larger than
31 // this value, then a flush is triggered for all the column families. The
32 // default value is 0, which means flush is always triggered. If you move
33 // away from the default, the checkpoint may not contain up-to-date data
34 // if WAL writing is not always enabled.
35 // Flush will always trigger if it is 2PC.
36 virtual Status CreateCheckpoint(const std::string& checkpoint_dir,
37 uint64_t log_size_for_flush = 0);
38
39 virtual ~Checkpoint() {}
40 };
41
42 } // namespace rocksdb
43 #endif // !ROCKSDB_LITE