Definition at line 189 of file db_test.cc.
§ OptionConfig
| Enumerator |
|---|
| kDefault | |
| kReuse | |
| kFilter | |
| kUncompressed | |
| kEnd | |
Definition at line 194 of file db_test.cc.
§ DBTest()
| leveldb::DBTest::DBTest |
( |
| ) |
|
|
inline |
Definition at line 210 of file db_test.cc.
Status DestroyDB(const std::string &dbname, const Options &options)
void Reopen(Options *options=NULL)
const FilterPolicy * NewBloomFilterPolicy(int bits_per_key)
const FilterPolicy * filter_policy_
§ ~DBTest()
| leveldb::DBTest::~DBTest |
( |
| ) |
|
|
inline |
Definition at line 219 of file db_test.cc.
Status DestroyDB(const std::string &dbname, const Options &options)
const FilterPolicy * filter_policy_
§ AllEntriesFor()
| std::string leveldb::DBTest::AllEntriesFor |
( |
const Slice & |
user_key | ) |
|
|
inline |
Definition at line 341 of file db_test.cc.
344 iter->Seek(target.Encode());
346 if (!iter->status().ok()) {
347 result = iter->status().ToString();
351 while (iter->Valid()) {
352 ParsedInternalKey ikey;
354 result +=
"CORRUPTED";
365 result += iter->value().ToString();
static const SequenceNumber kMaxSequenceNumber
bool ParseInternalKey(const Slice &internal_key, ParsedInternalKey *result)
Iterator * TEST_NewInternalIterator()
const Comparator * comparator
virtual int Compare(const Slice &a, const Slice &b) const =0
§ ChangeOptions()
| bool leveldb::DBTest::ChangeOptions |
( |
| ) |
|
|
inline |
Definition at line 228 of file db_test.cc.
void DestroyAndReopen(Options *options=NULL)
§ Close()
| void leveldb::DBTest::Close |
( |
| ) |
|
|
inline |
§ Compact()
| void leveldb::DBTest::Compact |
( |
const Slice & |
start, |
|
|
const Slice & |
limit |
|
) |
| |
|
inline |
Definition at line 429 of file db_test.cc.
virtual void CompactRange(const Slice *begin, const Slice *end)=0
§ Contents()
| std::string leveldb::DBTest::Contents |
( |
| ) |
|
|
inline |
Definition at line 316 of file db_test.cc.
317 std::vector<std::string> forward;
320 for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
322 result.push_back(
'(');
324 result.push_back(
')');
325 forward.push_back(s);
330 for (iter->SeekToLast(); iter->Valid(); iter->Prev()) {
std::string IterStatus(Iterator *iter)
virtual Iterator * NewIterator(const ReadOptions &options)=0
§ CountFiles()
| int leveldb::DBTest::CountFiles |
( |
| ) |
|
|
inline |
Definition at line 416 of file db_test.cc.
417 std::vector<std::string> files;
419 return static_cast<int>(files.size());
Status GetChildren(const std::string &dir, std::vector< std::string > *r)
§ CurrentOptions()
| Options leveldb::DBTest::CurrentOptions |
( |
| ) |
|
|
inline |
Definition at line 239 of file db_test.cc.
241 options.reuse_logs =
false;
244 options.reuse_logs =
true;
const FilterPolicy * filter_policy_
§ dbfull()
| DBImpl* leveldb::DBTest::dbfull |
( |
| ) |
|
|
inline |
Definition at line 258 of file db_test.cc.
259 return reinterpret_cast<DBImpl*
>(
db_);
§ Delete()
| Status leveldb::DBTest::Delete |
( |
const std::string & |
k | ) |
|
|
inline |
Definition at line 297 of file db_test.cc.
virtual Status Delete(const WriteOptions &options, const Slice &key)=0
§ DeleteAnSSTFile()
| bool leveldb::DBTest::DeleteAnSSTFile |
( |
| ) |
|
|
inline |
Definition at line 478 of file db_test.cc.
479 std::vector<std::string> filenames;
483 for (
size_t i = 0; i < filenames.size(); i++) {
bool ParseFileName(const std::string &fname, uint64_t *number, FileType *type)
std::string TableFileName(const std::string &name, uint64_t number)
Status DeleteFile(const std::string &f)
Status GetChildren(const std::string &dir, std::vector< std::string > *r)
§ DestroyAndReopen()
| void leveldb::DBTest::DestroyAndReopen |
( |
Options * |
options = NULL | ) |
|
|
inline |
Definition at line 271 of file db_test.cc.
Status TryReopen(Options *options)
Status DestroyDB(const std::string &dbname, const Options &options)
§ DumpFileCounts()
| void leveldb::DBTest::DumpFileCounts |
( |
const char * |
label | ) |
|
|
inline |
Definition at line 449 of file db_test.cc.
450 fprintf(stderr,
"---\n%s:\n", label);
451 fprintf(stderr,
"maxoverlap: %lld\n",
452 static_cast<long long>(
453 dbfull()->TEST_MaxNextLevelOverlappingBytes()));
457 fprintf(stderr,
" level %3d : %d files\n", level, num);
static const int kNumLevels
int NumTableFilesAtLevel(int level)
§ DumpSSTableList()
| std::string leveldb::DBTest::DumpSSTableList |
( |
| ) |
|
|
inline |
Definition at line 462 of file db_test.cc.
463 std::string property;
virtual bool GetProperty(const Slice &property, std::string *value)=0
§ FilesPerLevel()
| std::string leveldb::DBTest::FilesPerLevel |
( |
| ) |
|
|
inline |
Definition at line 400 of file db_test.cc.
402 int last_non_zero_offset = 0;
406 snprintf(buf,
sizeof(buf),
"%s%d", (level ?
"," :
""), f);
409 last_non_zero_offset = result.size();
412 result.resize(last_non_zero_offset);
static const int kNumLevels
int NumTableFilesAtLevel(int level)
§ FillLevels()
| void leveldb::DBTest::FillLevels |
( |
const std::string & |
smallest, |
|
|
const std::string & |
largest |
|
) |
| |
|
inline |
Definition at line 445 of file db_test.cc.
static const int kNumLevels
void MakeTables(int n, const std::string &small, const std::string &large)
§ Get()
| std::string leveldb::DBTest::Get |
( |
const std::string & |
k, |
|
|
const Snapshot * |
snapshot = NULL |
|
) |
| |
|
inline |
Definition at line 301 of file db_test.cc.
303 options.snapshot = snapshot;
305 Status s =
db_->
Get(options, k, &result);
306 if (s.IsNotFound()) {
307 result =
"NOT_FOUND";
308 }
else if (!s.ok()) {
std::string ToString() const
virtual Status Get(const ReadOptions &options, const Slice &key, std::string *value)=0
§ IterStatus()
| std::string leveldb::DBTest::IterStatus |
( |
Iterator * |
iter | ) |
|
|
inline |
Definition at line 468 of file db_test.cc.
471 result = iter->key().ToString() +
"->" + iter->value().ToString();
473 result =
"(invalid)";
§ MakeTables()
| void leveldb::DBTest::MakeTables |
( |
int |
n, |
|
|
const std::string & |
small, |
|
|
const std::string & |
large |
|
) |
| |
|
inline |
Definition at line 435 of file db_test.cc.
436 for (
int i = 0; i < n; i++) {
Status TEST_CompactMemTable()
Status Put(const std::string &k, const std::string &v)
§ NumTableFilesAtLevel()
| int leveldb::DBTest::NumTableFilesAtLevel |
( |
int |
level | ) |
|
|
inline |
Definition at line 383 of file db_test.cc.
384 std::string property;
388 return atoi(property.c_str());
virtual bool GetProperty(const Slice &property, std::string *value)=0
std::string NumberToString(uint64_t num)
§ Put()
| Status leveldb::DBTest::Put |
( |
const std::string & |
k, |
|
|
const std::string & |
v |
|
) |
| |
|
inline |
Definition at line 293 of file db_test.cc.
294 return db_->
Put(WriteOptions(), k, v);
virtual Status Put(const WriteOptions &options, const Slice &key, const Slice &value)=0
§ RenameLDBToSST()
| int leveldb::DBTest::RenameLDBToSST |
( |
| ) |
|
|
inline |
Definition at line 493 of file db_test.cc.
494 std::vector<std::string> filenames;
498 int files_renamed = 0;
499 for (
size_t i = 0; i < filenames.size(); i++) {
507 return files_renamed;
bool ParseFileName(const std::string &fname, uint64_t *number, FileType *type)
std::string TableFileName(const std::string &name, uint64_t number)
Status RenameFile(const std::string &s, const std::string &t)
std::string SSTTableFileName(const std::string &name, uint64_t number)
Status GetChildren(const std::string &dir, std::vector< std::string > *r)
§ Reopen()
| void leveldb::DBTest::Reopen |
( |
Options * |
options = NULL | ) |
|
|
inline |
Definition at line 262 of file db_test.cc.
Status TryReopen(Options *options)
§ Size()
| uint64_t leveldb::DBTest::Size |
( |
const Slice & |
start, |
|
|
const Slice & |
limit |
|
) |
| |
|
inline |
Definition at line 422 of file db_test.cc.
423 Range r(start, limit);
virtual void GetApproximateSizes(const Range *range, int n, uint64_t *sizes)=0
§ TotalTableFiles()
| int leveldb::DBTest::TotalTableFiles |
( |
| ) |
|
|
inline |
Definition at line 391 of file db_test.cc.
static const int kNumLevels
int NumTableFilesAtLevel(int level)
§ TryReopen()
Definition at line 278 of file db_test.cc.
282 if (options != NULL) {
286 opts.create_if_missing =
true;
static Status Open(const Options &options, const std::string &name, DB **dbptr)
§ db_
§ dbname_
| std::string leveldb::DBTest::dbname_ |
§ env_
§ filter_policy_
§ last_options_
| Options leveldb::DBTest::last_options_ |
§ option_config_
| int leveldb::DBTest::option_config_ |
|
private |
The documentation for this class was generated from the following file: