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

Method Trace

be/src/runtime/io/data-cache.cc:1510–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1508}
1509
1510void DataCache::Partition::Trace(
1511 const trace::EventType& type, const DataCache::CacheKey& key,
1512 int64_t lookup_len, int64_t entry_len) {
1513 if (tracer_ == nullptr) return;
1514
1515 // When tracing a percentage of the requests, we want to trace all the accesses for a
1516 // consistent subset of the entries rather than a subset of accesses for all entries.
1517 // This gives the access trace more useful data.
1518 //
1519 // This uses the hash to determine a consistent subset to trace. Note that this is
1520 // tracing at the partition level. If there are multiple partitions, the entry has
1521 // been mapped to a specific partition by taking a modulus of the hash value. This
1522 // can impact which bits are still useful. For example, if there are two partitions,
1523 // this would have only even hash values or only odd hash values. To minimize the
1524 // impact of this, we use 101 rather than 100, because 101 is prime.
1525 uint64_t unsigned_key_hash = static_cast<uint64_t>(key.Hash());
1526 if (FLAGS_data_cache_trace_percentage < 100 &&
1527 unsigned_key_hash % 101 >= FLAGS_data_cache_trace_percentage) {
1528 return;
1529 }
1530
1531 tracer_->Trace(type, WallTime_Now(), key.filename(), key.mtime(), key.offset(),
1532 lookup_len, entry_len);
1533}
1534
1535} // namespace io
1536} // namespace impala

Callers 1

TraceFromTraceEventMethod · 0.45

Calls 5

WallTime_NowFunction · 0.85
HashMethod · 0.45
filenameMethod · 0.45
mtimeMethod · 0.45
offsetMethod · 0.45

Tested by 1

TraceFromTraceEventMethod · 0.36