MCPcopy Create free account
hub / github.com/apache/impala / Insert

Method Insert

be/src/util/cache/cache-internal.h:113–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 HandleBase* Insert(HandleBase* h) {
114 HandleBase** ptr = FindPointer(h->key(), h->hash());
115 HandleBase* old = *ptr;
116 h->next_handle_ = (old == nullptr ? nullptr : old->next_handle_);
117 *ptr = h;
118 if (old == nullptr) {
119 ++elems_;
120 if (elems_ > length_) {
121 // Since each cache entry is fairly large, we aim for a small
122 // average linked list length (<= 1).
123 Resize();
124 }
125 } else {
126 old->next_handle_ = nullptr;
127 }
128 return old;
129 }
130
131 HandleBase* Remove(const Slice& key, uint32_t hash) {
132 HandleBase** ptr = FindPointer(key, hash);

Callers 1

InsertMethod · 0.45

Calls 2

hashMethod · 0.80
keyMethod · 0.45

Tested by

no test coverage detected