#include <table_cache.h>
|
| | TableCache (const std::string &dbname, const Options *options, int entries) |
| |
| | ~TableCache () |
| |
| Iterator * | NewIterator (const ReadOptions &options, uint64_t file_number, uint64_t file_size, Table **tableptr=NULL) |
| |
| Status | Get (const ReadOptions &options, uint64_t file_number, uint64_t file_size, const Slice &k, void *arg, void(*handle_result)(void *, const Slice &, const Slice &)) |
| |
| void | Evict (uint64_t file_number) |
| |
Definition at line 21 of file table_cache.h.
§ TableCache()
| leveldb::TableCache::TableCache |
( |
const std::string & |
dbname, |
|
|
const Options * |
options, |
|
|
int |
entries |
|
) |
| |
Definition at line 32 of file table_cache.cc.
Cache * NewLRUCache(size_t capacity)
const std::string dbname_
§ ~TableCache()
| leveldb::TableCache::~TableCache |
( |
| ) |
|
§ Evict()
| void leveldb::TableCache::Evict |
( |
uint64_t |
file_number | ) |
|
Definition at line 121 of file table_cache.cc.
122 char buf[
sizeof(file_number)];
void EncodeFixed64(char *buf, uint64_t value)
virtual void Erase(const Slice &key)=0
§ FindTable()
| Status leveldb::TableCache::FindTable |
( |
uint64_t |
file_number, |
|
|
uint64_t |
file_size, |
|
|
Cache::Handle ** |
handle |
|
) |
| |
|
private |
Definition at line 45 of file table_cache.cc.
48 char buf[
sizeof(file_number)];
50 Slice key(buf,
sizeof(buf));
52 if (*handle == NULL) {
54 RandomAccessFile* file = NULL;
68 assert(table == NULL);
73 TableAndFile* tf =
new TableAndFile;
virtual Handle * Insert(const Slice &key, void *value, size_t charge, void(*deleter)(const Slice &key, void *value))=0
static void DeleteEntry(const Slice &key, void *value)
static Status Open(const Options &options, RandomAccessFile *file, uint64_t file_size, Table **table)
virtual Handle * Lookup(const Slice &key)=0
std::string TableFileName(const std::string &name, uint64_t number)
virtual Status NewRandomAccessFile(const std::string &fname, RandomAccessFile **result)=0
void EncodeFixed64(char *buf, uint64_t value)
std::string SSTTableFileName(const std::string &name, uint64_t number)
const std::string dbname_
§ Get()
| Status leveldb::TableCache::Get |
( |
const ReadOptions & |
options, |
|
|
uint64_t |
file_number, |
|
|
uint64_t |
file_size, |
|
|
const Slice & |
k, |
|
|
void * |
arg, |
|
|
void(*)(void *, const Slice &, const Slice &) |
handle_result |
|
) |
| |
Definition at line 105 of file table_cache.cc.
111 Cache::Handle* handle = NULL;
112 Status s =
FindTable(file_number, file_size, &handle);
114 Table* t =
reinterpret_cast<TableAndFile*
>(
cache_->
Value(handle))->table;
115 s = t->InternalGet(options, k, arg, saver);
virtual void Release(Handle *handle)=0
virtual void * Value(Handle *handle)=0
Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle **)
§ NewIterator()
| Iterator * leveldb::TableCache::NewIterator |
( |
const ReadOptions & |
options, |
|
|
uint64_t |
file_number, |
|
|
uint64_t |
file_size, |
|
|
Table ** |
tableptr = NULL |
|
) |
| |
Definition at line 82 of file table_cache.cc.
86 if (tableptr != NULL) {
90 Cache::Handle* handle = NULL;
91 Status s =
FindTable(file_number, file_size, &handle);
96 Table* table =
reinterpret_cast<TableAndFile*
>(
cache_->
Value(handle))->table;
97 Iterator* result = table->NewIterator(options);
99 if (tableptr != NULL) {
virtual void * Value(Handle *handle)=0
Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle **)
Iterator * NewErrorIterator(const Status &status)
static void UnrefEntry(void *arg1, void *arg2)
§ cache_
| Cache* leveldb::TableCache::cache_ |
|
private |
§ dbname_
| const std::string leveldb::TableCache::dbname_ |
|
private |
§ env_
| Env* const leveldb::TableCache::env_ |
|
private |
§ options_
| const Options* leveldb::TableCache::options_ |
|
private |
The documentation for this class was generated from the following files: