| /leveldb-1.20/db/ |
| H A D | skiplist.h | 53 void Insert(const Key& key); 70 const Key& key() const; 150 Key const key; 187 return new (mem) Node(key); 204 return node_->key; 258 return (n != NULL) && (compare_(n->key, key) < 0); 289 assert(x == head_ || compare_(x->key, key) < 0); 291 if (next == NULL || compare_(next->key, key) >= 0) { 344 assert(x == NULL || !Equal(key, x->key)); 363 x = NewNode(key, height); [all …]
|
| H A D | skiplist_test.cc | 56 Key key = rnd.Next() % R; in TEST() local 57 if (keys.insert(key).second) { in TEST() 58 list.Insert(key); in TEST() 153 static uint64_t key(Key key) { return (key >> 40); } in key() argument 154 static uint64_t gen(Key key) { return (key >> 8) & 0xffffffffu; } in gen() argument 155 static uint64_t hash(Key key) { return key & 0xff; } in hash() argument 220 const Key key = MakeKey(k, g); in WriteStep() local 221 list_.Insert(key); in WriteStep() 240 current = iter.key(); in ReadStep() 248 ASSERT_LT(key(pos), K) << pos; in ReadStep() [all …]
|
| H A D | write_batch.cc | 49 Slice key, value; in Iterate() local 57 if (GetLengthPrefixedSlice(&input, &key) && in Iterate() 59 handler->Put(key, value); in Iterate() 65 if (GetLengthPrefixedSlice(&input, &key)) { in Iterate() 66 handler->Delete(key); in Iterate() 101 PutLengthPrefixedSlice(&rep_, key); in Put() 105 void WriteBatch::Delete(const Slice& key) { in Delete() argument 108 PutLengthPrefixedSlice(&rep_, key); in Delete() 118 mem_->Add(sequence_, kTypeValue, key, value); in Put() 121 virtual void Delete(const Slice& key) { in Delete() argument [all …]
|
| H A D | dbformat.cc | 18 void AppendInternalKey(std::string* result, const ParsedInternalKey& key) { in AppendInternalKey() argument 19 result->append(key.user_key.data(), key.user_key.size()); in AppendInternalKey() 20 PutFixed64(result, PackSequenceAndType(key.sequence, key.type)); in AppendInternalKey() 87 void InternalKeyComparator::FindShortSuccessor(std::string* key) const { in FindShortSuccessor() 88 Slice user_key = ExtractUserKey(*key); in FindShortSuccessor() 96 assert(this->Compare(*key, tmp) < 0); in FindShortSuccessor() 97 key->swap(tmp); in FindShortSuccessor() 117 bool InternalFilterPolicy::KeyMayMatch(const Slice& key, const Slice& f) const { in KeyMayMatch() argument 118 return user_policy_->KeyMayMatch(ExtractUserKey(key), f); in KeyMayMatch()
|
| H A D | memtable.cc | 61 virtual Slice key() const { return GetLengthPrefixedSlice(iter_.key()); } in key() function in leveldb::MemTableIterator 63 Slice key_slice = GetLengthPrefixedSlice(iter_.key()); in value() 83 const Slice& key, in Add() argument 90 size_t key_size = key.size(); in Add() 98 memcpy(p, key.data(), key_size); in Add() 108 bool MemTable::Get(const LookupKey& key, std::string* value, Status* s) { in Get() argument 109 Slice memkey = key.memtable_key(); in Get() 122 const char* entry = iter.key(); in Get() 127 key.user_key()) == 0) { in Get()
|
| H A D | dumpfile.cc | 76 AppendEscapedStringTo(&r, key); in Put() 82 virtual void Delete(const Slice& key) { in Delete() argument 84 AppendEscapedStringTo(&r, key); in Delete() 170 ParsedInternalKey key; in DumpTable() local 171 if (!ParseInternalKey(iter->key(), &key)) { in DumpTable() 173 AppendEscapedStringTo(&r, iter->key()); in DumpTable() 180 AppendEscapedStringTo(&r, key.user_key); in DumpTable() 182 AppendNumberTo(&r, key.sequence); in DumpTable() 184 if (key.type == kTypeDeletion) { in DumpTable() 186 } else if (key.type == kTypeValue) { in DumpTable() [all …]
|
| H A D | c.cc | 97 const char* key, size_t length, 122 return (*key_match_)(state_, key.data(), key.size(), in KeyMayMatch() 173 const char* key, size_t keylen, in leveldb_put() argument 183 const char* key, size_t keylen, in leveldb_delete() argument 200 const char* key, size_t keylen, in leveldb_get() argument 322 Slice s = iter->rep->key(); in leveldb_iter_key() 351 const char* key, size_t klen, in leveldb_writebatch_put() argument 358 const char* key, size_t klen) { in leveldb_writebatch_delete() argument 359 b->rep.Delete(Slice(key, klen)); in leveldb_writebatch_delete() 373 (*put_)(state_, key.data(), key.size(), value.data(), value.size()); in leveldb_writebatch_iterate() [all …]
|
| H A D | builder.cc | 36 meta->smallest.DecodeFrom(iter->key()); in BuildTable() 38 Slice key = iter->key(); in BuildTable() local 39 meta->largest.DecodeFrom(key); in BuildTable() 40 builder->Add(key, iter->value()); in BuildTable()
|
| H A D | db_bench.cc | 760 snprintf(key, sizeof(key), "%016d", k); in DoWrite() 805 char key[100]; in ReadRandom() local 807 snprintf(key, sizeof(key), "%016d", k); in ReadRandom() 822 char key[100]; in ReadMissing() local 824 snprintf(key, sizeof(key), "%016d.", k); in ReadMissing() 835 char key[100]; in ReadHot() local 837 snprintf(key, sizeof(key), "%016d", k); in ReadHot() 850 snprintf(key, sizeof(key), "%016d", k); in SeekRandom() 852 if (iter->Valid() && iter->key() == key) found++; in SeekRandom() 870 snprintf(key, sizeof(key), "%016d", k); in DoDelete() [all …]
|
| H A D | db_iter.cc | 23 if (!ParseInternalKey(iter->key(), &k)) { 24 fprintf(stderr, "Corrupt '%s'\n", EscapeString(iter->key()).c_str()); 66 virtual Slice key() const { in key() function in leveldb::__anon9603b1580111::DBIter 68 return (direction_ == kForward) ? ExtractUserKey(iter_->key()) : saved_key_; in key() 91 bool ParseKey(ParsedInternalKey* key); 131 Slice k = iter_->key(); in ParseKey() 167 SaveKey(ExtractUserKey(iter_->key()), &saved_key_); in Next() 212 SaveKey(ExtractUserKey(iter_->key()), &saved_key_); in Prev() 221 if (user_comparator_->Compare(ExtractUserKey(iter_->key()), in Prev() 255 SaveKey(ExtractUserKey(iter_->key()), &saved_key_); in FindPrevUserEntry()
|
| /leveldb-1.20/util/ |
| H A D | cache.cc | 55 Slice key() const { in key() function 77 return *FindPointer(key, hash); in Lookup() 119 ((*ptr)->hash != hash || key != (*ptr)->key())) { in FindPointer() 234 (*e->deleter)(e->key(), e->value); in Unref() 279 e->key_length = key.size(); in Insert() 283 memcpy(e->key_data, key.data(), key.size()); in Insert() 320 FinishErase(table_.Remove(key, hash)); in Erase() 363 const uint32_t hash = HashSlice(key); in Insert() 367 const uint32_t hash = HashSlice(key); in Lookup() 374 virtual void Erase(const Slice& key) { in Erase() argument [all …]
|
| H A D | comparator.cc | 53 virtual void FindShortSuccessor(std::string* key) const { in FindShortSuccessor() 55 size_t n = key->size(); in FindShortSuccessor() 57 const uint8_t byte = (*key)[i]; in FindShortSuccessor() 59 (*key)[i] = byte + 1; in FindShortSuccessor() 60 key->resize(i+1); in FindShortSuccessor()
|
| H A D | bloom.cc | 13 static uint32_t BloomHash(const Slice& key) { in BloomHash() argument 14 return Hash(key.data(), key.size(), 0xbc9f1d34); in BloomHash() 63 virtual bool KeyMayMatch(const Slice& key, const Slice& bloom_filter) const { in KeyMayMatch() argument 79 uint32_t h = BloomHash(key); in KeyMayMatch()
|
| H A D | cache_test.cc | 30 static void Deleter(const Slice& key, void* v) { in Deleter() argument 31 current_->deleted_keys_.push_back(DecodeKey(key)); in Deleter() 48 int Lookup(int key) { in Lookup() argument 49 Cache::Handle* handle = cache_->Lookup(EncodeKey(key)); in Lookup() 57 void Insert(int key, int value, int charge = 1) { in Insert() argument 58 cache_->Release(cache_->Insert(EncodeKey(key), EncodeValue(value), charge, in Insert() 62 Cache::Handle* InsertAndReturnHandle(int key, int value, int charge = 1) { in InsertAndReturnHandle() argument 63 return cache_->Insert(EncodeKey(key), EncodeValue(value), charge, in InsertAndReturnHandle() 67 void Erase(int key) { in Erase() argument 68 cache_->Erase(EncodeKey(key)); in Erase()
|
| /leveldb-1.20/table/ |
| H A D | block_builder.cc | 73 void BlockBuilder::Add(const Slice& key, const Slice& value) { in Add() argument 78 || options_->comparator->Compare(key, last_key_piece) > 0); in Add() 82 const size_t min_length = std::min(last_key_piece.size(), key.size()); in Add() 83 while ((shared < min_length) && (last_key_piece[shared] == key[shared])) { in Add() 91 const size_t non_shared = key.size() - shared; in Add() 99 buffer_.append(key.data() + shared, non_shared); in Add() 104 last_key_.append(key.data() + shared, non_shared); in Add() 105 assert(Slice(last_key_) == key); in Add()
|
| H A D | merger.cc | 71 child->Seek(key()); in Next() 73 comparator_->Compare(key(), child->key()) == 0) { in Next() 97 child->Seek(key()); in Prev() 114 virtual Slice key() const { in key() function in leveldb::__anon119e0de30111::MergingIterator 116 return current_->key(); in key() 162 } else if (comparator_->Compare(child->key(), smallest->key()) < 0) { in FindSmallest() 177 } else if (comparator_->Compare(child->key(), largest->key()) > 0) { in FindLargest()
|
| H A D | table.cc | 110 std::string key = "filter."; in ReadMeta() local 111 key.append(rep_->options.filter_policy->Name()); in ReadMeta() 112 iter->Seek(key); in ReadMeta() 113 if (iter->Valid() && iter->key() == Slice(key)) { in ReadMeta() 151 static void DeleteCachedBlock(const Slice& key, void* value) { in DeleteCachedBlock() argument 184 Slice key(cache_key_buffer, sizeof(cache_key_buffer)); in BlockReader() local 185 cache_handle = block_cache->Lookup(key); in BlockReader() 194 key, block, block->size(), &DeleteCachedBlock); in BlockReader() 244 (*saver)(arg, block_iter->key(), block_iter->value()); in InternalGet() 258 uint64_t Table::ApproximateOffsetOf(const Slice& key) const { in ApproximateOffsetOf() [all …]
|
| H A D | table_builder.cc | 92 void TableBuilder::Add(const Slice& key, const Slice& value) { in Add() argument 97 assert(r->options.comparator->Compare(key, Slice(r->last_key)) > 0); in Add() 102 r->options.comparator->FindShortestSeparator(&r->last_key, key); in Add() 110 r->filter_block->AddKey(key); in Add() 113 r->last_key.assign(key.data(), key.size()); in Add() 115 r->data_block.Add(key, value); in Add() 218 std::string key = "filter."; in Finish() local 219 key.append(r->options.filter_policy->Name()); in Finish() 222 meta_index_block.Add(key, handle_encoding); in Finish()
|
| H A D | table_test.cc | 28 std::string str(key.ToString()); in Reverse() 58 std::string s = Reverse(*key); in FindShortSuccessor() 60 *key = Reverse(s); in FindShortSuccessor() 68 key->push_back('\0'); in Increment() 71 std::string rev = Reverse(*key); in Increment() 73 *key = Reverse(rev); in Increment() 147 data_[key] = value.ToString(); in Add() 292 virtual Slice key() const { in key() function in leveldb::KeyConvertingIterator 294 ParsedInternalKey key; in key() local 295 if (!ParseInternalKey(iter_->key(), &key)) { in key() [all …]
|
| H A D | filter_block.cc | 30 void FilterBlockBuilder::AddKey(const Slice& key) { in AddKey() argument 31 Slice k = key; in AddKey() 95 bool FilterBlockReader::KeyMayMatch(uint64_t block_offset, const Slice& key) { in KeyMayMatch() argument 102 return policy_->KeyMayMatch(key, filter); in KeyMayMatch()
|
| /leveldb-1.20/include/leveldb/ |
| H A D | write_batch.h | 37 void Put(const Slice& key, const Slice& value); 40 void Delete(const Slice& key); 49 virtual void Put(const Slice& key, const Slice& value) = 0; 50 virtual void Delete(const Slice& key) = 0;
|
| H A D | cache.h | 52 virtual Handle* Insert(const Slice& key, void* value, size_t charge, 53 void (*deleter)(const Slice& key, void* value)) = 0; 60 virtual Handle* Lookup(const Slice& key) = 0; 76 virtual void Erase(const Slice& key) = 0;
|
| H A D | c.h | 82 const char* key, size_t keylen, 89 const char* key, size_t keylen, 103 const char* key, size_t keylen, 168 const char* key, size_t klen, 172 const char* key, size_t klen); 233 const char* key, size_t length,
|
| /leveldb-1.20/issues/ |
| H A D | issue200_test.cc | 40 ASSERT_EQ(iter->key().ToString(), "5"); in TEST() 42 ASSERT_EQ(iter->key().ToString(), "4"); in TEST() 44 ASSERT_EQ(iter->key().ToString(), "3"); in TEST() 46 ASSERT_EQ(iter->key().ToString(), "4"); in TEST() 48 ASSERT_EQ(iter->key().ToString(), "5"); in TEST()
|
| /leveldb-1.20/doc/bench/ |
| H A D | db_bench_tree_db.cc | 200 Slice key = TrimSpace(Slice(line, sep - 1 - line)); in PrintEnvironment() local 202 if (key == "model name") { in PrintEnvironment() 205 } else if (key == "cache size") { in PrintEnvironment() 448 char key[100]; in Write() local 449 snprintf(key, sizeof(key), "%016d", k); in Write() 450 bytes_ += value_size + strlen(key); in Write() 451 std::string cpp_key = key; in Write() 473 char key[100]; in ReadRandom() local 475 snprintf(key, sizeof(key), "%016d", k); in ReadRandom() 476 db_->get(key, &value); in ReadRandom()
|