]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/compacted_db_impl.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / db / compacted_db_impl.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 #ifndef ROCKSDB_LITE
8 #include "db/db_impl.h"
9 #include <vector>
10 #include <string>
11
12 namespace rocksdb {
13
14 class CompactedDBImpl : public DBImpl {
15 public:
16 CompactedDBImpl(const DBOptions& options, const std::string& dbname);
17 virtual ~CompactedDBImpl();
18
19 static Status Open(const Options& options, const std::string& dbname,
20 DB** dbptr);
21
22 // Implementations of the DB interface
23 using DB::Get;
24 virtual Status Get(const ReadOptions& options,
25 ColumnFamilyHandle* column_family, const Slice& key,
26 PinnableSlice* value) override;
27 using DB::MultiGet;
28 virtual std::vector<Status> MultiGet(
29 const ReadOptions& options,
30 const std::vector<ColumnFamilyHandle*>&,
31 const std::vector<Slice>& keys, std::vector<std::string>* values)
32 override;
33
34 using DBImpl::Put;
35 virtual Status Put(const WriteOptions& /*options*/,
36 ColumnFamilyHandle* /*column_family*/,
37 const Slice& /*key*/, const Slice& /*value*/) override {
38 return Status::NotSupported("Not supported in compacted db mode.");
39 }
40 using DBImpl::Merge;
41 virtual Status Merge(const WriteOptions& /*options*/,
42 ColumnFamilyHandle* /*column_family*/,
43 const Slice& /*key*/, const Slice& /*value*/) override {
44 return Status::NotSupported("Not supported in compacted db mode.");
45 }
46 using DBImpl::Delete;
47 virtual Status Delete(const WriteOptions& /*options*/,
48 ColumnFamilyHandle* /*column_family*/,
49 const Slice& /*key*/) override {
50 return Status::NotSupported("Not supported in compacted db mode.");
51 }
52 virtual Status Write(const WriteOptions& /*options*/,
53 WriteBatch* /*updates*/) override {
54 return Status::NotSupported("Not supported in compacted db mode.");
55 }
56 using DBImpl::CompactRange;
57 virtual Status CompactRange(const CompactRangeOptions& /*options*/,
58 ColumnFamilyHandle* /*column_family*/,
59 const Slice* /*begin*/,
60 const Slice* /*end*/) override {
61 return Status::NotSupported("Not supported in compacted db mode.");
62 }
63
64 virtual Status DisableFileDeletions() override {
65 return Status::NotSupported("Not supported in compacted db mode.");
66 }
67 virtual Status EnableFileDeletions(bool /*force*/) override {
68 return Status::NotSupported("Not supported in compacted db mode.");
69 }
70 virtual Status GetLiveFiles(std::vector<std::string>&,
71 uint64_t* /*manifest_file_size*/,
72 bool /*flush_memtable*/ = true) override {
73 return Status::NotSupported("Not supported in compacted db mode.");
74 }
75 using DBImpl::Flush;
76 virtual Status Flush(const FlushOptions& /*options*/,
77 ColumnFamilyHandle* /*column_family*/) override {
78 return Status::NotSupported("Not supported in compacted db mode.");
79 }
80 using DB::IngestExternalFile;
81 virtual Status IngestExternalFile(
82 ColumnFamilyHandle* /*column_family*/,
83 const std::vector<std::string>& /*external_files*/,
84 const IngestExternalFileOptions& /*ingestion_options*/) override {
85 return Status::NotSupported("Not supported in compacted db mode.");
86 }
87
88 private:
89 friend class DB;
90 inline size_t FindFile(const Slice& key);
91 Status Init(const Options& options);
92
93 ColumnFamilyData* cfd_;
94 Version* version_;
95 const Comparator* user_comparator_;
96 LevelFilesBrief files_;
97
98 // No copying allowed
99 CompactedDBImpl(const CompactedDBImpl&);
100 void operator=(const CompactedDBImpl&);
101 };
102 }
103 #endif // ROCKSDB_LITE