| 482 | } |
| 483 | |
| 484 | void TmpFileMgr::RemoveRemoteDirForQuery(TmpFileGroup* file_group) { |
| 485 | if (tmp_dirs_remote_ == nullptr) return; |
| 486 | const string& dir = tmp_dirs_remote_->path_; |
| 487 | const string& hostname = ExecEnv::GetInstance()->configured_backend_address().hostname; |
| 488 | const string backend_id = PrintId(ExecEnv::GetInstance()->backend_id(), "_"); |
| 489 | const string query_id = PrintId(file_group->unique_id(), "_"); |
| 490 | const string querylevel_dir = |
| 491 | ConstructRemoteDirPath(dir, hostname, backend_id, query_id); |
| 492 | hdfsFS hdfs_conn; |
| 493 | Status status = |
| 494 | HdfsFsCache::instance()->GetConnection(querylevel_dir, &hdfs_conn, &hdfs_conns_); |
| 495 | if (status.ok()) { |
| 496 | DCHECK(hdfs_conn != nullptr); |
| 497 | hdfsDelete(hdfs_conn, querylevel_dir.c_str(), 1); |
| 498 | LOG(INFO) << "Called to remove the query-level remote directory " << querylevel_dir; |
| 499 | } else { |
| 500 | LOG(WARNING) << "Failed to remove the remote directory because unable to create a " |
| 501 | "connection to " |
| 502 | << querylevel_dir; |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | Status TmpFileMgr::AsyncWriteRange(WriteRange* write_range, TmpFile* tmp_file) { |
| 507 | if (write_range->disk_file()->disk_type() == io::DiskFileType::LOCAL) { |
no test coverage detected