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

Method Trace

be/src/runtime/io/data-cache-trace.cc:227–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void Tracer::Trace(EventType type, double timestamp, Slice filename, int64_t mtime,
228 int64_t offset, int64_t lookup_len, int64_t entry_len) {
229
230 // Sanity checks for lookup_len / entry_len
231 if (type == EventType::HIT) {
232 DCHECK(lookup_len > 0 && entry_len > 0);
233 } else if (type == EventType::MISS) {
234 DCHECK(lookup_len > 0 && entry_len == -1);
235 } else if (type == EventType::STORE || type == EventType::STORE_FAILED ||
236 type == EventType::STORE_FAILED_BUSY) {
237 DCHECK(lookup_len == -1 && entry_len > 0);
238 } else {
239 DCHECK(false) << "Unrecognized EventType";
240 }
241
242 string filename_str =
243 anonymize_trace_ ? AnonymizeFilename(filename) : filename.ToString();
244 TraceEvent event(type, timestamp, filename_str, mtime, offset, entry_len,
245 lookup_len);
246 string json = TraceEventToJson(event);
247 logger_->Write(/*force_flush="*/false, /*timestamp=*/0, json.data(), json.size());
248}
249
250string Tracer::AnonymizeFilename(Slice filename) {
251 uint128 hash = util_hash::CityHash128(reinterpret_cast<const char*>(filename.data()),

Callers

nothing calls this directly

Calls 5

TraceEventToJsonFunction · 0.85
ToStringMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected