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

Method TryEvictFile

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

Source from the content-addressed store, hash-verified

541}
542
543Status TmpFileMgr::TryEvictFile(TmpFile* tmp_file) {
544 DCHECK(tmp_file != nullptr);
545 if (tmp_file->disk_type() == io::DiskFileType::DUMMY) return Status::OK();
546
547 TmpFileRemote* tmp_file_remote = static_cast<TmpFileRemote*>(tmp_file);
548 DiskFile* buffer_file = tmp_file_remote->DiskBufferFile();
549
550 // Remove the buffer of the TmpFile.
551 // After deletion of the buffer, if the TmpFile doesn't exist in the remote file system
552 // either, that means the TmpFile shared pointer can be removed from the TmpFileMgr,
553 // because in this case, the physical file is considered no longer in the system.
554 // Hold the unique locks of the files during the deletion.
555 Status status = Status::OK();
556 {
557 unique_lock<shared_mutex> buffer_lock(buffer_file->physical_file_lock_);
558 if (buffer_file->GetFileStatus() == io::DiskFileStatus::PERSISTED) {
559 status = buffer_file->Delete(buffer_lock);
560 }
561 }
562 return status;
563}
564
565Status TmpFileMgr::ReserveLocalBufferSpace(bool quick_return) {
566 int64_t file_size = GetRemoteTmpFileSize();

Callers 2

TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 5

OKFunction · 0.85
DiskBufferFileMethod · 0.80
GetFileStatusMethod · 0.80
disk_typeMethod · 0.45
DeleteMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
TEST_FFunction · 0.64