| 311 | } |
| 312 | |
| 313 | void HdfsFileReader::CachedFile(uint8_t** data, int64_t* length) { |
| 314 | { |
| 315 | unique_lock<SpinLock> hdfs_lock(lock_); |
| 316 | DCHECK(cached_buffer_ == nullptr); |
| 317 | DCHECK(exclusive_hdfs_fh_ != nullptr); |
| 318 | cached_buffer_ = hadoopReadZero(exclusive_hdfs_fh_->file(), |
| 319 | scan_range_->io_mgr_->cached_read_options(), scan_range_->len()); |
| 320 | } |
| 321 | if (cached_buffer_ == nullptr) { |
| 322 | *data = nullptr; |
| 323 | *length = 0; |
| 324 | return; |
| 325 | } |
| 326 | *data = reinterpret_cast<uint8_t*>( |
| 327 | const_cast<void*>(hadoopRzBufferGet(cached_buffer_))); |
| 328 | *length = hadoopRzBufferLength(cached_buffer_); |
| 329 | } |
| 330 | |
| 331 | int64_t HdfsFileReader::ReadDataCache(DataCache* remote_data_cache, int64_t file_offset, |
| 332 | uint8_t* buffer, int64_t bytes_to_read) { |
no test coverage detected