]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/include/rocksdb/sst_file_reader.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / include / rocksdb / sst_file_reader.h
1 // Copyright (c) 2011-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).
5
6 #pragma once
7
8 #ifndef ROCKSDB_LITE
9
10 #include "rocksdb/iterator.h"
11 #include "rocksdb/options.h"
12 #include "rocksdb/slice.h"
13 #include "rocksdb/table_properties.h"
14
15 namespace ROCKSDB_NAMESPACE {
16
17 // SstFileReader is used to read sst files that are generated by DB or
18 // SstFileWriter.
19 class SstFileReader {
20 public:
21 SstFileReader(const Options& options);
22
23 ~SstFileReader();
24
25 // Prepares to read from the file located at "file_path".
26 Status Open(const std::string& file_path);
27
28 // Returns a new iterator over the table contents.
29 // Most read options provide the same control as we read from DB.
30 // If "snapshot" is nullptr, the iterator returns only the latest keys.
31 Iterator* NewIterator(const ReadOptions& options);
32
33 std::shared_ptr<const TableProperties> GetTableProperties() const;
34
35 // Verifies whether there is corruption in this table.
36 Status VerifyChecksum(const ReadOptions& /*read_options*/);
37
38 Status VerifyChecksum() { return VerifyChecksum(ReadOptions()); }
39
40 private:
41 struct Rep;
42 std::unique_ptr<Rep> rep_;
43 };
44
45 } // namespace ROCKSDB_NAMESPACE
46
47 #endif // !ROCKSDB_LITE