|
| static const uint32_t | K = 4 |
| |
Definition at line 149 of file skiplist_test.cc.
§ ConcurrentTest()
| leveldb::ConcurrentTest::ConcurrentTest |
( |
| ) |
|
|
inline |
§ gen()
| static uint64_t leveldb::ConcurrentTest::gen |
( |
Key |
key | ) |
|
|
inlinestaticprivate |
Definition at line 154 of file skiplist_test.cc.
154 {
return (
key >> 8) & 0xffffffffu; }
static uint64_t key(Key key)
§ hash()
| static uint64_t leveldb::ConcurrentTest::hash |
( |
Key |
key | ) |
|
|
inlinestaticprivate |
§ HashNumbers()
| static uint64_t leveldb::ConcurrentTest::HashNumbers |
( |
uint64_t |
k, |
|
|
uint64_t |
g |
|
) |
| |
|
inlinestaticprivate |
Definition at line 157 of file skiplist_test.cc.
158 uint64_t data[2] = { k, g };
159 return Hash(reinterpret_cast<char*>(data),
sizeof(data), 0);
uint32_t Hash(const char *data, size_t n, uint32_t seed)
§ IsValidKey()
| static bool leveldb::ConcurrentTest::IsValidKey |
( |
Key |
k | ) |
|
|
inlinestaticprivate |
Definition at line 169 of file skiplist_test.cc.
static uint64_t HashNumbers(uint64_t k, uint64_t g)
static uint64_t hash(Key key)
static uint64_t key(Key key)
static uint64_t gen(Key key)
§ key()
| static uint64_t leveldb::ConcurrentTest::key |
( |
Key |
key | ) |
|
|
inlinestaticprivate |
§ MakeKey()
| static Key leveldb::ConcurrentTest::MakeKey |
( |
uint64_t |
k, |
|
|
uint64_t |
g |
|
) |
| |
|
inlinestaticprivate |
Definition at line 162 of file skiplist_test.cc.
163 assert(
sizeof(
Key) ==
sizeof(uint64_t));
165 assert(g <= 0xffffffffu);
166 return ((k << 40) | (g << 8) | (
HashNumbers(k, g) & 0xff));
static uint64_t HashNumbers(uint64_t k, uint64_t g)
§ RandomTarget()
| static Key leveldb::ConcurrentTest::RandomTarget |
( |
Random * |
rnd | ) |
|
|
inlinestaticprivate |
Definition at line 173 of file skiplist_test.cc.
174 switch (rnd->Next() % 10) {
static Key MakeKey(uint64_t k, uint64_t g)
§ ReadStep()
| void leveldb::ConcurrentTest::ReadStep |
( |
Random * |
rnd | ) |
|
|
inline |
Definition at line 225 of file skiplist_test.cc.
228 for (
int k = 0; k <
K; k++) {
233 SkipList<Key, Comparator>::Iterator iter(&
list_);
240 current = iter.key();
243 ASSERT_LE(pos, current) <<
"should not go backwards";
247 while (pos < current) {
253 (
gen(pos) > static_cast<Key>(initial_state.Get(
key(pos))))
254 ) <<
"key: " <<
key(pos)
255 <<
"; gen: " <<
gen(pos)
257 << initial_state.Get(
key(pos));
260 if (
key(pos) <
key(current)) {
271 if (rnd->Next() % 2) {
276 if (new_target > pos) {
278 iter.Seek(new_target);
SkipList< Key, Comparator > list_
static Key RandomTarget(Random *rnd)
static Key MakeKey(uint64_t k, uint64_t g)
static uint64_t key(Key key)
static uint64_t gen(Key key)
static bool IsValidKey(Key k)
§ WriteStep()
| void leveldb::ConcurrentTest::WriteStep |
( |
Random * |
rnd | ) |
|
|
inline |
Definition at line 217 of file skiplist_test.cc.
218 const uint32_t k = rnd->Next() %
K;
SkipList< Key, Comparator > list_
void Set(int k, intptr_t v)
static Key MakeKey(uint64_t k, uint64_t g)
static uint64_t key(Key key)
§ arena_
| Arena leveldb::ConcurrentTest::arena_ |
|
private |
§ current_
| State leveldb::ConcurrentTest::current_ |
|
private |
| const uint32_t leveldb::ConcurrentTest::K = 4 |
|
staticprivate |
§ list_
The documentation for this class was generated from the following file: