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

Method TryDeleteReadBuffer

be/src/runtime/tmp-file-mgr.cc:1194–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1192
1193template <typename T>
1194void TmpFileRemote::TryDeleteReadBuffer(const T& lock, int buffer_idx) {
1195 DCheckReadBufferIdx(buffer_idx);
1196 bool reserved = false;
1197 bool allocated = false;
1198 DCHECK(disk_buffer_file_->IsBatchReadEnabled());
1199 DCHECK(lock.mutex() == disk_buffer_file_->GetFileLock() && lock.owns_lock());
1200 disk_buffer_file_->DeleteReadBuffer(
1201 disk_buffer_file_->GetBufferBlock(buffer_idx), &reserved, &allocated, lock);
1202 if (reserved || allocated) {
1203 // Because the reservation will increase the current allocated read buffer usage
1204 // ahead of the real allocation, we need to decrease it if the block is reserved
1205 // or allocated.
1206 file_group_->tmp_file_mgr_->scratch_read_memory_buffer_used_metric_->Increment(
1207 -1 * read_buffer_block_size_);
1208 }
1209}
1210
1211TmpDir* TmpFileRemote::GetLocalBufferDir() const {
1212 return file_group_->tmp_file_mgr_->GetLocalBufferDir();

Callers 1

Calls 7

IsBatchReadEnabledMethod · 0.80
GetFileLockMethod · 0.80
owns_lockMethod · 0.80
DeleteReadBufferMethod · 0.80
GetBufferBlockMethod · 0.80
mutexMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected