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

Method Close

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

Source from the content-addressed store, hash-verified

1371}
1372
1373void TmpFileGroup::Close() {
1374 // Cancel writes before deleting the files, since in-flight writes could re-create
1375 // deleted files.
1376 if (io_ctx_ != nullptr) {
1377 if (tmp_file_mgr_->HasRemoteDir()) {
1378 // Remove all the writes using the io_ctx and waiting for buffer reservation in
1379 // the pool.
1380 DCHECK(tmp_file_mgr_->tmp_dirs_remote_ctrl_.tmp_file_pool_ != nullptr);
1381 tmp_file_mgr_->tmp_dirs_remote_ctrl_.tmp_file_pool_->RemoveWriteRanges(
1382 io_ctx_.get());
1383 }
1384 io_mgr_->UnregisterContext(io_ctx_.get());
1385 }
1386 CloseInternal<std::unique_ptr<TmpFile>>(tmp_files_);
1387 CloseInternal<std::shared_ptr<TmpFile>>(tmp_files_remote_);
1388 tmp_file_mgr_->RemoveRemoteDirForQuery(this);
1389 tmp_file_mgr_->scratch_bytes_used_metric_->Increment(
1390 -1 * scratch_space_bytes_used_counter_->value());
1391}
1392
1393// Rounds up to the smallest unit of allocation in a scratch file
1394// that will fit 'bytes'.

Callers

nothing calls this directly

Calls 7

HasRemoteDirMethod · 0.80
RemoveWriteRangesMethod · 0.80
UnregisterContextMethod · 0.80
getMethod · 0.65
IncrementMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected