fork of https://github.com/oxigraph/rocksdb and https://github.com/facebook/rocksdb for nextgraph and oxigraph
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
4.5 KiB
119 lines
4.5 KiB
9 years ago
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
||
8 years ago
|
// This source code is licensed under both the GPLv2 (found in the
|
||
|
// COPYING file in the root directory) and Apache 2.0 License
|
||
|
// (found in the LICENSE.Apache file in the root directory).
|
||
10 years ago
|
|
||
|
#pragma once
|
||
|
#ifndef ROCKSDB_LITE
|
||
|
#include <string>
|
||
6 years ago
|
#include <vector>
|
||
|
#include "db/db_impl/db_impl.h"
|
||
10 years ago
|
|
||
5 years ago
|
namespace ROCKSDB_NAMESPACE {
|
||
10 years ago
|
|
||
|
class CompactedDBImpl : public DBImpl {
|
||
|
public:
|
||
|
CompactedDBImpl(const DBOptions& options, const std::string& dbname);
|
||
5 years ago
|
// No copying allowed
|
||
|
CompactedDBImpl(const CompactedDBImpl&) = delete;
|
||
|
void operator=(const CompactedDBImpl&) = delete;
|
||
|
|
||
4 years ago
|
~CompactedDBImpl() override;
|
||
10 years ago
|
|
||
|
static Status Open(const Options& options, const std::string& dbname,
|
||
|
DB** dbptr);
|
||
|
|
||
|
// Implementations of the DB interface
|
||
|
using DB::Get;
|
||
|
virtual Status Get(const ReadOptions& options,
|
||
|
ColumnFamilyHandle* column_family, const Slice& key,
|
||
8 years ago
|
PinnableSlice* value) override;
|
||
10 years ago
|
using DB::MultiGet;
|
||
|
virtual std::vector<Status> MultiGet(
|
||
|
const ReadOptions& options,
|
||
|
const std::vector<ColumnFamilyHandle*>&,
|
||
|
const std::vector<Slice>& keys, std::vector<std::string>* values)
|
||
|
override;
|
||
10 years ago
|
|
||
|
using DBImpl::Put;
|
||
7 years ago
|
virtual Status Put(const WriteOptions& /*options*/,
|
||
|
ColumnFamilyHandle* /*column_family*/,
|
||
|
const Slice& /*key*/, const Slice& /*value*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
|
using DBImpl::Merge;
|
||
7 years ago
|
virtual Status Merge(const WriteOptions& /*options*/,
|
||
|
ColumnFamilyHandle* /*column_family*/,
|
||
|
const Slice& /*key*/, const Slice& /*value*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
|
using DBImpl::Delete;
|
||
7 years ago
|
virtual Status Delete(const WriteOptions& /*options*/,
|
||
|
ColumnFamilyHandle* /*column_family*/,
|
||
|
const Slice& /*key*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
7 years ago
|
virtual Status Write(const WriteOptions& /*options*/,
|
||
|
WriteBatch* /*updates*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
|
using DBImpl::CompactRange;
|
||
7 years ago
|
virtual Status CompactRange(const CompactRangeOptions& /*options*/,
|
||
|
ColumnFamilyHandle* /*column_family*/,
|
||
|
const Slice* /*begin*/,
|
||
|
const Slice* /*end*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
|
|
||
|
virtual Status DisableFileDeletions() override {
|
||
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
7 years ago
|
virtual Status EnableFileDeletions(bool /*force*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
6 years ago
|
virtual Status GetLiveFiles(std::vector<std::string>& ret,
|
||
|
uint64_t* manifest_file_size,
|
||
|
bool /*flush_memtable*/) override {
|
||
|
return DBImpl::GetLiveFiles(ret, manifest_file_size,
|
||
|
false /* flush_memtable */);
|
||
10 years ago
|
}
|
||
|
using DBImpl::Flush;
|
||
7 years ago
|
virtual Status Flush(const FlushOptions& /*options*/,
|
||
|
ColumnFamilyHandle* /*column_family*/) override {
|
||
10 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
4 years ago
|
|
||
|
virtual Status SyncWAL() override {
|
||
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
|
|
||
8 years ago
|
using DB::IngestExternalFile;
|
||
|
virtual Status IngestExternalFile(
|
||
7 years ago
|
ColumnFamilyHandle* /*column_family*/,
|
||
|
const std::vector<std::string>& /*external_files*/,
|
||
|
const IngestExternalFileOptions& /*ingestion_options*/) override {
|
||
8 years ago
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
6 years ago
|
using DB::CreateColumnFamilyWithImport;
|
||
|
virtual Status CreateColumnFamilyWithImport(
|
||
|
const ColumnFamilyOptions& /*options*/,
|
||
|
const std::string& /*column_family_name*/,
|
||
|
const ImportColumnFamilyOptions& /*import_options*/,
|
||
|
const ExportImportFilesMetaData& /*metadata*/,
|
||
|
ColumnFamilyHandle** /*handle*/) override {
|
||
|
return Status::NotSupported("Not supported in compacted db mode.");
|
||
|
}
|
||
10 years ago
|
|
||
|
private:
|
||
|
friend class DB;
|
||
10 years ago
|
inline size_t FindFile(const Slice& key);
|
||
10 years ago
|
Status Init(const Options& options);
|
||
|
|
||
|
ColumnFamilyData* cfd_;
|
||
|
Version* version_;
|
||
|
const Comparator* user_comparator_;
|
||
10 years ago
|
LevelFilesBrief files_;
|
||
10 years ago
|
};
|
||
5 years ago
|
} // namespace ROCKSDB_NAMESPACE
|
||
10 years ago
|
#endif // ROCKSDB_LITE
|