| 443 | } |
| 444 | |
| 445 | void TmpFileMgr::NewFile( |
| 446 | TmpFileGroup* file_group, DeviceId device_id, unique_ptr<TmpFile>* new_file) { |
| 447 | DCHECK(initialized_); |
| 448 | DCHECK_GE(device_id, 0); |
| 449 | DCHECK_LT(device_id, tmp_dirs_.size()); |
| 450 | DCHECK(file_group != nullptr); |
| 451 | // Generate the full file path. |
| 452 | string unique_name = lexical_cast<string>(random_generator()()); |
| 453 | stringstream file_name; |
| 454 | file_name << PrintId(file_group->unique_id()) << "_" << unique_name; |
| 455 | path new_file_path(tmp_dirs_[device_id]->path_); |
| 456 | new_file_path /= file_name.str(); |
| 457 | |
| 458 | new_file->reset(new TmpFileLocal(file_group, device_id, new_file_path.string())); |
| 459 | } |
| 460 | |
| 461 | static string ConstructRemoteDirPath(const string& base_dir, const string& hostname, |
| 462 | const string& backend_id = "", const string& query_id = "") { |
no test coverage detected