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

Method PunchHole

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

Source from the content-addressed store, hash-verified

956}
957
958Status TmpFile::PunchHole(int64_t offset, int64_t len) {
959 DCHECK(file_group_->tmp_file_mgr_->punch_holes());
960 // Because of RAII, the file is automatically closed when this function returns.
961 RWFileOptions opts;
962 opts.mode = Env::CREATE_OR_OPEN;
963 unique_ptr<RWFile> file;
964 KUDU_RETURN_IF_ERROR(Env::Default()->NewRWFile(opts, path_, &file),
965 "Failed to open scratch file for hole punching");
966 KUDU_RETURN_IF_ERROR(
967 file->PunchHole(offset, len), "Failed to punch hole in scratch file");
968 bytes_reclaimed_.Add(len);
969 GetDir()->bytes_used_metric()->Increment(-len);
970 VLOG(3) << "Punched hole in " << path_ << " " << offset << " " << len;
971 return Status::OK();
972}
973
974string TmpFile::DebugString() {
975 return Substitute(

Callers 2

RecycleFileRangeMethod · 0.45
CheckHolePunchMethod · 0.45

Calls 7

DefaultClass · 0.85
OKFunction · 0.85
punch_holesMethod · 0.80
NewRWFileMethod · 0.80
bytes_used_metricMethod · 0.80
AddMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected