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

Function CreateEntry

be/src/runtime/tuple-cache-mgr.cc:340–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340static Cache::UniquePendingHandle CreateEntry(
341 Cache* cache, const Slice& key, const string& path) {
342 Cache::UniquePendingHandle pending =
343 cache->Allocate(key, sizeof(TupleCacheEntry) + path.size() + 1);
344 if (!pending) {
345 return pending;
346 }
347
348 // buf is used to store a TupleCacheEntry, followed by the path.
349 uint8_t* buf = cache->MutableValue(&pending);
350 new (buf) TupleCacheEntry{};
351 char* path_s = reinterpret_cast<char*>(buf + sizeof(TupleCacheEntry));
352 memcpy(path_s, path.data(), path.size());
353 // Null terminate because UniquePendingHandle doesn't provide access to size.
354 path_s[path.size()] = '\0';
355
356 return pending;
357}
358
359// If the entry exists, the Handle pins it so it doesn't go away, but the entry may be in
360// any state (IN PROGRESS, TOMBSTONE, COMPLETE_UNSYNCED, COMPLETE). If the entry doesn't

Callers 1

LookupMethod · 0.85

Calls 4

AllocateMethod · 0.45
sizeMethod · 0.45
MutableValueMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected