MCPcopy Create free account
hub / github.com/apache/impala / CachedFile

Method CachedFile

be/src/runtime/io/hdfs-file-reader.cc:313–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313void 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
331int64_t HdfsFileReader::ReadDataCache(DataCache* remote_data_cache, int64_t file_offset,
332 uint8_t* buffer, int64_t bytes_to_read) {

Callers 1

ReadFromCacheMethod · 0.45

Calls 3

cached_read_optionsMethod · 0.80
fileMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected