1 // Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
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).
11 #include "file/filename.h"
12 #include "rocksdb/db.h"
13 #include "rocksdb/utilities/checkpoint.h"
15 namespace ROCKSDB_NAMESPACE
{
17 class CheckpointImpl
: public Checkpoint
{
19 explicit CheckpointImpl(DB
* db
) : db_(db
) {}
21 Status
CreateCheckpoint(const std::string
& checkpoint_dir
,
22 uint64_t log_size_for_flush
,
23 uint64_t* sequence_number_ptr
) override
;
25 Status
ExportColumnFamily(ColumnFamilyHandle
* handle
,
26 const std::string
& export_dir
,
27 ExportImportFilesMetaData
** metadata
) override
;
29 // Checkpoint logic can be customized by providing callbacks for link, copy,
31 Status
CreateCustomCheckpoint(
32 std::function
<Status(const std::string
& src_dirname
,
33 const std::string
& fname
, FileType type
)>
35 std::function
<Status(const std::string
& src_dirname
,
36 const std::string
& fname
, uint64_t size_limit_bytes
,
37 FileType type
, const std::string
& checksum_func_name
,
38 const std::string
& checksum_val
,
39 const Temperature src_temperature
)>
41 std::function
<Status(const std::string
& fname
,
42 const std::string
& contents
, FileType type
)>
44 uint64_t* sequence_number
, uint64_t log_size_for_flush
,
45 bool get_live_table_checksum
= false);
48 void CleanStagingDirectory(const std::string
& path
, Logger
* info_log
);
50 // Export logic customization by providing callbacks for link or copy.
51 Status
ExportFilesInMetaData(
52 const DBOptions
& db_options
, const ColumnFamilyMetaData
& metadata
,
53 std::function
<Status(const std::string
& src_dirname
,
54 const std::string
& fname
)>
56 std::function
<Status(const std::string
& src_dirname
,
57 const std::string
& fname
)>
64 } // namespace ROCKSDB_NAMESPACE
66 #endif // ROCKSDB_LITE