| 1003 | } |
| 1004 | |
| 1005 | Status TmpFileLocal::Remove() { |
| 1006 | // Remove the file if present (it may not be present if no writes completed). |
| 1007 | Status status = FileSystemUtil::RemovePaths({path_}); |
| 1008 | int64_t bytes_in_use = file_group_->tmp_file_mgr_->punch_holes() ? |
| 1009 | allocation_offset_ - bytes_reclaimed_.Load() : |
| 1010 | allocation_offset_; |
| 1011 | GetDir()->bytes_used_metric()->Increment(-bytes_in_use); |
| 1012 | return status; |
| 1013 | } |
| 1014 | |
| 1015 | TmpFileRemote::TmpFileRemote(TmpFileGroup* file_group, TmpFileMgr::DeviceId device_id, |
| 1016 | const std::string& path, const std::string& local_buffer_path, bool expected_local, |