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

Method Delete

be/src/runtime/io/disk-file.cc:33–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 TErrorCode::GENERAL, "DiskFile::Delete() failed with incorrect status"));
32
33Status DiskFile::Delete(const unique_lock<shared_mutex>& lock) {
34 DCHECK(lock.mutex() == &physical_file_lock_ && lock.owns_lock());
35 Status status = Status::OK();
36 unique_lock<SpinLock> status_l(status_lock_);
37 // No support for remote file deletion yet.
38 if (disk_type_ == DiskFileType::LOCAL_BUFFER || disk_type_ == DiskFileType::LOCAL) {
39 if (is_deleted(status_l)) return DISK_FILE_DELETE_FAILED_INCORRECT_STATUS;
40 if (file_writer_ != nullptr) {
41 // Close the file writer to release the file handle.
42 RETURN_IF_ERROR(file_writer_->Close());
43 }
44 // Remove the local physical file if it exists.
45 RETURN_IF_ERROR(FileSystemUtil::RemovePaths({path_}));
46 SetStatusLocked(io::DiskFileStatus::DELETED, status_l);
47 }
48 return status;
49}
50
51DiskFile::DiskFile(const string& path, DiskIoMgr* io_mgr)
52 : path_(path),

Callers 6

TryEvictFileMethod · 0.45
RemoveMethod · 0.45
UnregisterMethod · 0.45
DeleteReadBufferMethod · 0.45

Calls 4

OKFunction · 0.85
owns_lockMethod · 0.80
mutexMethod · 0.45
CloseMethod · 0.45

Tested by 2