Definition at line 13 of file autocompact_test.cc.
§ AutoCompactTest()
| leveldb::AutoCompactTest::AutoCompactTest |
( |
| ) |
|
|
inline |
Definition at line 20 of file autocompact_test.cc.
Status DestroyDB(const std::string &dbname, const Options &options)
static Status Open(const Options &options, const std::string &name, DB **dbptr)
Cache * NewLRUCache(size_t capacity)
CompressionType compression
§ ~AutoCompactTest()
| leveldb::AutoCompactTest::~AutoCompactTest |
( |
| ) |
|
|
inline |
Definition at line 30 of file autocompact_test.cc.
Status DestroyDB(const std::string &dbname, const Options &options)
§ DoReads()
| void leveldb::AutoCompactTest::DoReads |
( |
int |
n | ) |
|
Definition at line 58 of file autocompact_test.cc.
60 DBImpl* dbi =
reinterpret_cast<DBImpl*
>(
db_);
63 for (
int i = 0; i <
kCount; i++) {
69 for (
int i = 0; i <
kCount; i++) {
75 const int64_t initial_size =
Size(
Key(0),
Key(n));
76 const int64_t initial_other_size =
Size(
Key(n),
Key(kCount));
79 std::string limit_key =
Key(n);
80 for (
int read = 0;
true; read++) {
81 ASSERT_LT(read, 100) <<
"Taking too long to compact";
83 for (iter->SeekToFirst();
84 iter->Valid() && iter->key().ToString() < limit_key;
92 fprintf(stderr,
"iter %3d => %7.3f MB [other %7.3f MB]\n",
93 read+1, size/1048576.0,
Size(
Key(n),
Key(kCount))/1048576.0);
94 if (size <= initial_size/10) {
101 const int64_t final_other_size =
Size(
Key(n),
Key(kCount));
102 ASSERT_LE(final_other_size, initial_other_size + 1048576);
103 ASSERT_GE(final_other_size, initial_other_size/5 - 1048576);
uint64_t Size(const Slice &start, const Slice &limit)
virtual void SleepForMicroseconds(int micros)=0
static const int kValueSize
virtual Status Put(const WriteOptions &options, const Slice &key, const Slice &value)=0
virtual Status Delete(const WriteOptions &options, const Slice &key)=0
virtual Iterator * NewIterator(const ReadOptions &options)=0
§ Key()
| std::string leveldb::AutoCompactTest::Key |
( |
int |
i | ) |
|
|
inline |
Definition at line 36 of file autocompact_test.cc.
38 snprintf(buf,
sizeof(buf),
"key%06d", i);
39 return std::string(buf);
§ Size()
| uint64_t leveldb::AutoCompactTest::Size |
( |
const Slice & |
start, |
|
|
const Slice & |
limit |
|
) |
| |
|
inline |
Definition at line 42 of file autocompact_test.cc.
43 Range r(start, limit);
virtual void GetApproximateSizes(const Range *range, int n, uint64_t *sizes)=0
§ db_
| DB* leveldb::AutoCompactTest::db_ |
§ dbname_
| std::string leveldb::AutoCompactTest::dbname_ |
§ options_
| Options leveldb::AutoCompactTest::options_ |
§ tiny_cache_
| Cache* leveldb::AutoCompactTest::tiny_cache_ |
The documentation for this class was generated from the following file: