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

Method Add

be/src/util/sharded-query-map-util.cc:40–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39template <typename K, typename V>
40Status GenericShardedQueryMap<K, V>::Add(const K& query_id, const V& obj) {
41 GenericScopedShardedMapRef<K, V> map_ref(query_id, this);
42 DCHECK(map_ref.get() != nullptr);
43
44 auto entry = map_ref->find(query_id);
45 if (entry != map_ref->end()) {
46 // There shouldn't be an active query with that same id.
47 // (query_id is globally unique)
48 return Status(ErrorMsg(TErrorCode::INTERNAL_ERROR,
49 strings::Substitute("query id $0 already exists", PrintId(query_id))));
50 }
51 map_ref->insert(make_pair(query_id, obj));
52 if (size_metric_ != nullptr) size_metric_->Increment(1);
53 return Status::OK();
54}
55
56template <typename K, typename V>
57Status GenericShardedQueryMap<K, V>::Get(const K& query_id, V* obj) {

Callers

nothing calls this directly

Calls 10

ErrorMsgClass · 0.85
SubstituteFunction · 0.85
PrintIdFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70
getMethod · 0.65
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected