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

Method AllocateSpace

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

Source from the content-addressed store, hash-verified

986}
987
988bool TmpFileLocal::AllocateSpace(int64_t num_bytes, int64_t* offset) {
989 DCHECK_GT(num_bytes, 0);
990 TmpDir* dir = GetDir();
991 // Increment optimistically and roll back if the limit is exceeded.
992 if (dir->bytes_used_metric()->Increment(num_bytes) > dir->bytes_limit()) {
993 dir->bytes_used_metric()->Increment(-num_bytes);
994 return false;
995 }
996 *offset = allocation_offset_;
997 allocation_offset_ += num_bytes;
998 return true;
999}
1000
1001io::DiskFile* TmpFileLocal::GetWriteFile() {
1002 return disk_file_.get();

Callers 5

AllocateRemoteSpaceMethod · 0.45
AllocateLocalSpaceMethod · 0.45
WriteMethod · 0.45
FileAllocateSpaceMethod · 0.45
GroupAllocateSpaceMethod · 0.45

Calls 6

bytes_used_metricMethod · 0.80
bytes_limitMethod · 0.80
SetActualFileSizeMethod · 0.80
IncrementMethod · 0.45
emptyMethod · 0.45
okMethod · 0.45

Tested by 2

FileAllocateSpaceMethod · 0.36
GroupAllocateSpaceMethod · 0.36