#include <db.h>
|
| | DB () |
| |
| virtual | ~DB () |
| |
| virtual Status | Put (const WriteOptions &options, const Slice &key, const Slice &value)=0 |
| |
| virtual Status | Delete (const WriteOptions &options, const Slice &key)=0 |
| |
| virtual Status | Write (const WriteOptions &options, WriteBatch *updates)=0 |
| |
| virtual Status | Get (const ReadOptions &options, const Slice &key, std::string *value)=0 |
| |
| virtual Iterator * | NewIterator (const ReadOptions &options)=0 |
| |
| virtual const Snapshot * | GetSnapshot ()=0 |
| |
| virtual void | ReleaseSnapshot (const Snapshot *snapshot)=0 |
| |
| virtual bool | GetProperty (const Slice &property, std::string *value)=0 |
| |
| virtual void | GetApproximateSizes (const Range *range, int n, uint64_t *sizes)=0 |
| |
| virtual void | CompactRange (const Slice *begin, const Slice *end)=0 |
| |
Definition at line 44 of file db.h.
§ DB() [1/2]
Definition at line 55 of file db.h.
§ ~DB()
§ DB() [2/2]
| leveldb::DB::DB |
( |
const DB & |
| ) |
|
|
private |
§ CompactRange()
| virtual void leveldb::DB::CompactRange |
( |
const Slice * |
begin, |
|
|
const Slice * |
end |
|
) |
| |
|
pure virtual |
§ Delete()
§ Get()
§ GetApproximateSizes()
| virtual void leveldb::DB::GetApproximateSizes |
( |
const Range * |
range, |
|
|
int |
n, |
|
|
uint64_t * |
sizes |
|
) |
| |
|
pure virtual |
§ GetProperty()
| virtual bool leveldb::DB::GetProperty |
( |
const Slice & |
property, |
|
|
std::string * |
value |
|
) |
| |
|
pure virtual |
§ GetSnapshot()
| virtual const Snapshot* leveldb::DB::GetSnapshot |
( |
| ) |
|
|
pure virtual |
§ NewIterator()
§ Open()
| Status leveldb::DB::Open |
( |
const Options & |
options, |
|
|
const std::string & |
name, |
|
|
DB ** |
dbptr |
|
) |
| |
|
static |
Definition at line 1490 of file db_impl.cc.
1494 DBImpl* impl =
new DBImpl(options,
dbname);
1495 impl->mutex_.Lock();
1498 bool save_manifest =
false;
1499 Status s = impl->Recover(&edit, &save_manifest);
1500 if (s.ok() && impl->mem_ == NULL) {
1502 uint64_t new_log_number = impl->versions_->NewFileNumber();
1503 WritableFile* lfile;
1507 edit.SetLogNumber(new_log_number);
1508 impl->logfile_ = lfile;
1509 impl->logfile_number_ = new_log_number;
1510 impl->log_ =
new log::Writer(lfile);
1511 impl->mem_ =
new MemTable(impl->internal_comparator_);
1515 if (s.ok() && save_manifest) {
1516 edit.SetPrevLogNumber(0);
1517 edit.SetLogNumber(impl->logfile_number_);
1518 s = impl->versions_->LogAndApply(&edit, &impl->mutex_);
1521 impl->DeleteObsoleteFiles();
1522 impl->MaybeScheduleCompaction();
1524 impl->mutex_.Unlock();
1526 assert(impl->mem_ != NULL);
std::string LogFileName(const std::string &name, uint64_t number)
§ operator=()
| void leveldb::DB::operator= |
( |
const DB & |
| ) |
|
|
private |
§ Put()
§ ReleaseSnapshot()
| virtual void leveldb::DB::ReleaseSnapshot |
( |
const Snapshot * |
snapshot | ) |
|
|
pure virtual |
§ Write()
The documentation for this class was generated from the following files: