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

Method PunchHole

be/src/runtime/io/data-cache.cc:298–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 }
297
298 void PunchHole(int64_t offset, int64_t hole_size) {
299 DCHECK_EQ(offset % PAGE_SIZE, 0);
300 DCHECK_EQ(hole_size % PAGE_SIZE, 0);
301 if (UNLIKELY(readonly_.Load())) return;
302 // Hold the lock in shared mode to check if 'file_' is not closed already.
303 kudu::shared_lock<rw_spinlock> lock(lock_.get_lock());
304 if (UNLIKELY(!file_ || readonly_.Load())) return;
305 DCHECK_LE(offset + hole_size, current_offset_.Load());
306 kudu::Status status = file_->PunchHole(offset, hole_size);
307 if (UNLIKELY(!status.ok())) {
308 LOG(DFATAL) << Substitute("Failed to punch hole in $0 at offset $1 for $2 $3",
309 path_, offset, PrettyPrinter::PrintBytes(hole_size), status.ToString());
310 }
311 }
312
313 Status Flush() {
314 std::unique_lock<percpu_rwlock> lock(lock_);

Callers 1

EvictedEntryMethod · 0.45

Calls 6

SubstituteFunction · 0.85
PrintBytesFunction · 0.85
LoadMethod · 0.45
get_lockMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected