MCPcopy Create free account
hub / github.com/apache/arrow / insert

Method insert

cpp/src/gandiva/lru_cache.h:57–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 bool contains(const key_type& key) { return map_.find(key) != map_.end(); }
56
57 void insert(const key_type& key, const value_type& value) {
58 typename map_type::iterator i = map_.find(key);
59 if (i == map_.end()) {
60 // insert item into the cache, but first check if it is full
61 if (size() >= cache_capacity_) {
62 // cache is full, evict the least recently used item
63 evict();
64 }
65
66 // insert the new item
67 lru_list_.push_front(key);
68 map_[key] = std::make_pair(value, lru_list_.begin());
69 }
70 }
71
72 std::optional<value_type> get(const key_type& key) {
73 // lookup value in the cache

Callers 15

MergeFromMethod · 0.45
MergeMethod · 0.45
test_cython_apiFunction · 0.45
test_visit_stringsFunction · 0.45
GenerateLevelsFunction · 0.45
set_read_dictionaryFunction · 0.45
TestFullRoundtripMethod · 0.45
AddPageMethod · 0.45
InitForLengthMethod · 0.45
TYPED_TESTFunction · 0.45

Calls 4

sizeFunction · 0.50
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 13

test_cython_apiFunction · 0.36
test_visit_stringsFunction · 0.36
TestFullRoundtripMethod · 0.36
InitForLengthMethod · 0.36
TYPED_TESTFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
BuildKeyMapFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36