| 965 | } |
| 966 | |
| 967 | Status DiskIoMgr::GetExclusiveHdfsFileHandle(const hdfsFS& fs, |
| 968 | std::string* fname, int64_t mtime, RequestContext *reader, |
| 969 | unique_ptr<ExclusiveHdfsFileHandle>& fid_out) { |
| 970 | SCOPED_TIMER(reader->open_file_timer_); |
| 971 | unique_ptr<ExclusiveHdfsFileHandle> fid; |
| 972 | fid.reset(new ExclusiveHdfsFileHandle(fs, fname, mtime)); |
| 973 | RETURN_IF_ERROR(fid->Init(&hdfs_monitor_)); |
| 974 | fid_out.swap(fid); |
| 975 | ImpaladMetrics::IO_MGR_NUM_FILE_HANDLES_OUTSTANDING->Increment(1L); |
| 976 | // Every exclusive file handle is considered a cache miss |
| 977 | ImpaladMetrics::IO_MGR_CACHED_FILE_HANDLES_HIT_RATIO->Update(0L); |
| 978 | ImpaladMetrics::IO_MGR_CACHED_FILE_HANDLES_MISS_COUNT->Increment(1L); |
| 979 | reader->cached_file_handles_miss_count_.Add(1L); |
| 980 | return Status::OK(); |
| 981 | } |
| 982 | |
| 983 | void DiskIoMgr::ReleaseExclusiveHdfsFileHandle(unique_ptr<ExclusiveHdfsFileHandle> fid) { |
| 984 | DCHECK(fid != nullptr); |