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

Method FindOrInsert

be/src/util/fixed-size-hash-table.h:110–119  ·  view source on GitHub ↗

Try to find entry, and insert default_val if not present. Return a pointer to the value. key should not be null.

Source from the content-addressed store, hash-verified

108 /// Try to find entry, and insert default_val if not present. Return a pointer to the
109 /// value. key should not be null.
110 V* FindOrInsert(const K key, const V& default_val) {
111 DCHECK_LT(size_, capacity_);
112 Entry* entry = FindEntry(key);
113 if (entry->key == NULL) {
114 entry->key = key;
115 entry->val = default_val;
116 ++size_;
117 }
118 return &entry->val;
119 }
120
121 uint32_t size() const { return size_; }
122

Callers 2

SerializeInternalMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64