| 504 | } |
| 505 | |
| 506 | Status TmpFileMgr::AsyncWriteRange(WriteRange* write_range, TmpFile* tmp_file) { |
| 507 | if (write_range->disk_file()->disk_type() == io::DiskFileType::LOCAL) { |
| 508 | DCHECK(write_range != nullptr); |
| 509 | DCHECK(write_range->io_ctx() != nullptr); |
| 510 | return write_range->io_ctx()->AddWriteRange(write_range); |
| 511 | } |
| 512 | // If spill to a remote directory, TmpFileBufferPool is helping to send the writes to |
| 513 | // the DiskQueue because the local buffer for the remote file may be used up and it may |
| 514 | // need to wait in the pool before the writes can be sent to the DiskQueue. |
| 515 | DCHECK(tmp_dirs_remote_ctrl_.tmp_file_pool_ != nullptr); |
| 516 | DCHECK(tmp_file != nullptr); |
| 517 | return tmp_dirs_remote_ctrl_.tmp_file_pool_->EnqueueWriteRange(write_range, tmp_file); |
| 518 | } |
| 519 | |
| 520 | void TmpFileMgr::EnqueueTmpFilesPoolDummyFile() { |
| 521 | EnqueueTmpFilesPool(tmp_dirs_remote_ctrl_.tmp_file_pool_->tmp_file_dummy_, true); |