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

Method EvictedEntry

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

Source from the content-addressed store, hash-verified

573}
574
575void TupleCacheMgr::EvictedEntry(Slice key, Slice value) {
576 const TupleCacheEntry* entry = reinterpret_cast<const TupleCacheEntry*>(value.data());
577 if (TupleCacheState::TOMBSTONE != entry->state) {
578 DCHECK(tuple_cache_entries_evicted_ != nullptr);
579 DCHECK(tuple_cache_entries_in_use_ != nullptr);
580 DCHECK(tuple_cache_entries_in_use_bytes_ != nullptr);
581 tuple_cache_entries_evicted_->Increment(1);
582 tuple_cache_entries_in_use_->Increment(-1);
583 DCHECK_GE(tuple_cache_entries_in_use_->GetValue(), 0);
584 // entries_in_use_bytes is incremented only when the entry reaches the
585 // COMPLETE_UNSYNCED state
586 if (TupleCacheState::COMPLETE_UNSYNCED == entry->state ||
587 TupleCacheState::COMPLETE == entry->state) {
588 tuple_cache_entries_in_use_bytes_->Increment(-entry->charge);
589 DCHECK_GE(tuple_cache_entries_in_use_bytes_->GetValue(), 0);
590 }
591 // Outstanding write bytes are accumulated during IN_PROGRESS, and remain set until
592 // the transition from COMPLETE_UNSYNCED to COMPLETE.
593 if (TupleCacheState::COMPLETE_UNSYNCED == entry->state ||
594 TupleCacheState::IN_PROGRESS == entry->state) {
595 DCHECK(tuple_cache_outstanding_writes_bytes_ != nullptr);
596 DCHECK_GE(tuple_cache_outstanding_writes_bytes_->GetValue(), entry->charge);
597 tuple_cache_outstanding_writes_bytes_->Increment(-entry->charge);
598 }
599 } else {
600 DCHECK(tuple_cache_tombstones_in_use_ != nullptr);
601 tuple_cache_tombstones_in_use_->Increment(-1);
602 DCHECK_GE(tuple_cache_tombstones_in_use_->GetValue(), 0);
603 }
604 // Retrieve the path following TupleCacheEntry.
605 value.remove_prefix(sizeof(TupleCacheEntry));
606 value.truncate(value.size() - 1);
607 VLOG_FILE << "Tuple Cache: Evict " << key << " at " << value.ToString();
608 // Delete file on disk.
609 kudu::Status status = kudu::Env::Default()->DeleteFile(value.ToString());
610 if (!status.ok()) {
611 LOG(WARNING) <<
612 Substitute("Failed to unlink $0: $1", value.ToString(), status.ToString());
613 }
614 // If correctness checking is enabled, remove the associated metadata as well.
615 if (DebugDumpEnabled()) {
616 string key_str(reinterpret_cast<const char*>(key.data()), key.size());
617 RemoveMetadataForTupleCache(key_str);
618 }
619}
620
621Status TupleCacheMgr::DeleteExistingFiles() const {
622 vector<string> entries;

Callers

nothing calls this directly

Calls 11

DefaultClass · 0.85
SubstituteFunction · 0.85
remove_prefixMethod · 0.80
dataMethod · 0.45
IncrementMethod · 0.45
GetValueMethod · 0.45
truncateMethod · 0.45
sizeMethod · 0.45
ToStringMethod · 0.45
DeleteFileMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected