Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
leveldb::DBImpl Class Reference

#include <db_impl.h>

Inheritance diagram for leveldb::DBImpl:
Inheritance graph
[legend]
Collaboration diagram for leveldb::DBImpl:
Collaboration graph
[legend]

Classes

struct  CompactionState
 
struct  CompactionStats
 
struct  ManualCompaction
 
struct  Writer
 

Public Member Functions

 DBImpl (const Options &options, const std::string &dbname)
 
virtual ~DBImpl ()
 
virtual Status Put (const WriteOptions &, const Slice &key, const Slice &value)
 
virtual Status Delete (const WriteOptions &, const Slice &key)
 
virtual Status Write (const WriteOptions &options, WriteBatch *updates)
 
virtual Status Get (const ReadOptions &options, const Slice &key, std::string *value)
 
virtual IteratorNewIterator (const ReadOptions &)
 
virtual const SnapshotGetSnapshot ()
 
virtual void ReleaseSnapshot (const Snapshot *snapshot)
 
virtual bool GetProperty (const Slice &property, std::string *value)
 
virtual void GetApproximateSizes (const Range *range, int n, uint64_t *sizes)
 
virtual void CompactRange (const Slice *begin, const Slice *end)
 
void TEST_CompactRange (int level, const Slice *begin, const Slice *end)
 
Status TEST_CompactMemTable ()
 
IteratorTEST_NewInternalIterator ()
 
int64_t TEST_MaxNextLevelOverlappingBytes ()
 
void RecordReadSample (Slice key)
 
- Public Member Functions inherited from leveldb::DB
 DB ()
 
virtual ~DB ()
 

Private Member Functions

IteratorNewInternalIterator (const ReadOptions &, SequenceNumber *latest_snapshot, uint32_t *seed)
 
Status NewDB ()
 
Status Recover (VersionEdit *edit) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
void MaybeIgnoreError (Status *s) const
 
void DeleteObsoleteFiles ()
 
Status CompactMemTable () EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
Status RecoverLogFile (uint64_t log_number, VersionEdit *edit, SequenceNumber *max_sequence) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
Status WriteLevel0Table (MemTable *mem, VersionEdit *edit, Version *base) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
Status MakeRoomForWrite (bool force) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
WriteBatchBuildBatchGroup (Writer **last_writer)
 
void MaybeScheduleCompaction () EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
void BackgroundCall ()
 
Status BackgroundCompaction () EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
void CleanupCompaction (CompactionState *compact) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
Status DoCompactionWork (CompactionState *compact) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
Status OpenCompactionOutputFile (CompactionState *compact)
 
Status FinishCompactionOutputFile (CompactionState *compact, Iterator *input)
 
Status InstallCompactionResults (CompactionState *compact) EXCLUSIVE_LOCKS_REQUIRED(mutex_)
 
 DBImpl (const DBImpl &)
 
void operator= (const DBImpl &)
 
const Comparatoruser_comparator () const
 

Static Private Member Functions

static void BGWork (void *db)
 

Private Attributes

Env *const env_
 
const InternalKeyComparator internal_comparator_
 
const InternalFilterPolicy internal_filter_policy_
 
const Options options_
 
bool owns_info_log_
 
bool owns_cache_
 
const std::string dbname_
 
TableCachetable_cache_
 
FileLockdb_lock_
 
port::Mutex mutex_
 
port::AtomicPointer shutting_down_
 
port::CondVar bg_cv_
 
MemTablemem_
 
MemTableimm_
 
port::AtomicPointer has_imm_
 
WritableFilelogfile_
 
uint64_t logfile_number_
 
log::Writerlog_
 
uint32_t seed_
 
std::deque< Writer * > writers_
 
WriteBatchtmp_batch_
 
SnapshotList snapshots_
 
std::set< uint64_tpending_outputs_
 
bool bg_compaction_scheduled_
 
ManualCompactionmanual_compaction_
 
VersionSetversions_
 
Status bg_error_
 
int consecutive_compaction_errors_
 
CompactionStats stats_ [config::kNumLevels]
 

Friends

class DB
 

Additional Inherited Members

- Static Public Member Functions inherited from leveldb::DB
static Status Open (const Options &options, const std::string &name, DB **dbptr)
 

Detailed Description

Definition at line 26 of file db_impl.h.

Constructor & Destructor Documentation

leveldb::DBImpl::DBImpl ( const Options options,
const std::string &  dbname 
)

Definition at line 116 of file db_impl.cc.

leveldb::DBImpl::~DBImpl ( )
virtual

Definition at line 149 of file db_impl.cc.

leveldb::DBImpl::DBImpl ( const DBImpl )
private

Member Function Documentation

void leveldb::DBImpl::BackgroundCall ( )
private

Definition at line 619 of file db_impl.cc.

Status leveldb::DBImpl::BackgroundCompaction ( )
private

Definition at line 656 of file db_impl.cc.

void leveldb::DBImpl::BGWork ( void *  db)
staticprivate

Definition at line 615 of file db_impl.cc.

WriteBatch * leveldb::DBImpl::BuildBatchGroup ( Writer **  last_writer)
private

Definition at line 1222 of file db_impl.cc.

void leveldb::DBImpl::CleanupCompaction ( CompactionState compact)
private

Definition at line 738 of file db_impl.cc.

Status leveldb::DBImpl::CompactMemTable ( )
private

Definition at line 498 of file db_impl.cc.

void leveldb::DBImpl::CompactRange ( const Slice begin,
const Slice end 
)
virtual

Implements leveldb::DB.

Definition at line 531 of file db_impl.cc.

Status leveldb::DBImpl::Delete ( const WriteOptions options,
const Slice key 
)
virtual

Implements leveldb::DB.

Definition at line 1153 of file db_impl.cc.

void leveldb::DBImpl::DeleteObsoleteFiles ( )
private

Definition at line 219 of file db_impl.cc.

Status leveldb::DBImpl::DoCompactionWork ( CompactionState compact)
private

Definition at line 853 of file db_impl.cc.

Status leveldb::DBImpl::FinishCompactionOutputFile ( CompactionState compact,
Iterator input 
)
private

Definition at line 780 of file db_impl.cc.

Status leveldb::DBImpl::Get ( const ReadOptions options,
const Slice key,
std::string *  value 
)
virtual

Implements leveldb::DB.

Definition at line 1072 of file db_impl.cc.

void leveldb::DBImpl::GetApproximateSizes ( const Range range,
int  n,
uint64_t sizes 
)
virtual

Implements leveldb::DB.

Definition at line 1388 of file db_impl.cc.

bool leveldb::DBImpl::GetProperty ( const Slice property,
std::string *  value 
)
virtual

Implements leveldb::DB.

Definition at line 1334 of file db_impl.cc.

const Snapshot * leveldb::DBImpl::GetSnapshot ( )
virtual

Implements leveldb::DB.

Definition at line 1138 of file db_impl.cc.

Status leveldb::DBImpl::InstallCompactionResults ( CompactionState compact)
private

Definition at line 832 of file db_impl.cc.

Status leveldb::DBImpl::MakeRoomForWrite ( bool  force)
private

Definition at line 1271 of file db_impl.cc.

void leveldb::DBImpl::MaybeIgnoreError ( Status s) const
private

Definition at line 210 of file db_impl.cc.

void leveldb::DBImpl::MaybeScheduleCompaction ( )
private

Definition at line 599 of file db_impl.cc.

Status leveldb::DBImpl::NewDB ( )
private

Definition at line 178 of file db_impl.cc.

Iterator * leveldb::DBImpl::NewInternalIterator ( const ReadOptions options,
SequenceNumber latest_snapshot,
uint32_t seed 
)
private

Definition at line 1030 of file db_impl.cc.

Iterator * leveldb::DBImpl::NewIterator ( const ReadOptions options)
virtual

Implements leveldb::DB.

Definition at line 1119 of file db_impl.cc.

Status leveldb::DBImpl::OpenCompactionOutputFile ( CompactionState compact)
private

Definition at line 755 of file db_impl.cc.

void leveldb::DBImpl::operator= ( const DBImpl )
private
Status leveldb::DBImpl::Put ( const WriteOptions o,
const Slice key,
const Slice value 
)
virtual

Implements leveldb::DB.

Definition at line 1149 of file db_impl.cc.

void leveldb::DBImpl::RecordReadSample ( Slice  key)

Definition at line 1131 of file db_impl.cc.

Status leveldb::DBImpl::Recover ( VersionEdit edit)
private

Definition at line 269 of file db_impl.cc.

Status leveldb::DBImpl::RecoverLogFile ( uint64_t  log_number,
VersionEdit edit,
SequenceNumber max_sequence 
)
private

Definition at line 357 of file db_impl.cc.

void leveldb::DBImpl::ReleaseSnapshot ( const Snapshot snapshot)
virtual

Implements leveldb::DB.

Definition at line 1143 of file db_impl.cc.

Status leveldb::DBImpl::TEST_CompactMemTable ( )

Definition at line 583 of file db_impl.cc.

void leveldb::DBImpl::TEST_CompactRange ( int  level,
const Slice begin,
const Slice end 
)

Definition at line 548 of file db_impl.cc.

int64_t leveldb::DBImpl::TEST_MaxNextLevelOverlappingBytes ( )

Definition at line 1067 of file db_impl.cc.

Iterator * leveldb::DBImpl::TEST_NewInternalIterator ( )

Definition at line 1061 of file db_impl.cc.

const Comparator* leveldb::DBImpl::user_comparator ( ) const
inlineprivate

Definition at line 196 of file db_impl.h.

Status leveldb::DBImpl::Write ( const WriteOptions options,
WriteBatch updates 
)
virtual

Implements leveldb::DB.

Definition at line 1157 of file db_impl.cc.

Status leveldb::DBImpl::WriteLevel0Table ( MemTable mem,
VersionEdit edit,
Version base 
)
private

Definition at line 452 of file db_impl.cc.

Friends And Related Function Documentation

friend class DB
friend

Definition at line 68 of file db_impl.h.

Member Data Documentation

bool leveldb::DBImpl::bg_compaction_scheduled_
private

Definition at line 157 of file db_impl.h.

port::CondVar leveldb::DBImpl::bg_cv_
private

Definition at line 137 of file db_impl.h.

Status leveldb::DBImpl::bg_error_
private

Definition at line 172 of file db_impl.h.

int leveldb::DBImpl::consecutive_compaction_errors_
private

Definition at line 173 of file db_impl.h.

FileLock* leveldb::DBImpl::db_lock_
private

Definition at line 132 of file db_impl.h.

const std::string leveldb::DBImpl::dbname_
private

Definition at line 126 of file db_impl.h.

Env* const leveldb::DBImpl::env_
private

Definition at line 120 of file db_impl.h.

port::AtomicPointer leveldb::DBImpl::has_imm_
private

Definition at line 140 of file db_impl.h.

MemTable* leveldb::DBImpl::imm_
private

Definition at line 139 of file db_impl.h.

const InternalKeyComparator leveldb::DBImpl::internal_comparator_
private

Definition at line 121 of file db_impl.h.

const InternalFilterPolicy leveldb::DBImpl::internal_filter_policy_
private

Definition at line 122 of file db_impl.h.

log::Writer* leveldb::DBImpl::log_
private

Definition at line 143 of file db_impl.h.

WritableFile* leveldb::DBImpl::logfile_
private

Definition at line 141 of file db_impl.h.

uint64_t leveldb::DBImpl::logfile_number_
private

Definition at line 142 of file db_impl.h.

ManualCompaction* leveldb::DBImpl::manual_compaction_
private

Definition at line 167 of file db_impl.h.

MemTable* leveldb::DBImpl::mem_
private

Definition at line 138 of file db_impl.h.

port::Mutex leveldb::DBImpl::mutex_
private

Definition at line 135 of file db_impl.h.

const Options leveldb::DBImpl::options_
private

Definition at line 123 of file db_impl.h.

bool leveldb::DBImpl::owns_cache_
private

Definition at line 125 of file db_impl.h.

bool leveldb::DBImpl::owns_info_log_
private

Definition at line 124 of file db_impl.h.

std::set<uint64_t> leveldb::DBImpl::pending_outputs_
private

Definition at line 154 of file db_impl.h.

uint32_t leveldb::DBImpl::seed_
private

Definition at line 144 of file db_impl.h.

port::AtomicPointer leveldb::DBImpl::shutting_down_
private

Definition at line 136 of file db_impl.h.

SnapshotList leveldb::DBImpl::snapshots_
private

Definition at line 150 of file db_impl.h.

CompactionStats leveldb::DBImpl::stats_[config::kNumLevels]
private

Definition at line 190 of file db_impl.h.

TableCache* leveldb::DBImpl::table_cache_
private

Definition at line 129 of file db_impl.h.

WriteBatch* leveldb::DBImpl::tmp_batch_
private

Definition at line 148 of file db_impl.h.

VersionSet* leveldb::DBImpl::versions_
private

Definition at line 169 of file db_impl.h.

std::deque<Writer*> leveldb::DBImpl::writers_
private

Definition at line 147 of file db_impl.h.


The documentation for this class was generated from the following files: