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