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

Method GetHdfsStatistics

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

Source from the content-addressed store, hash-verified

403}
404
405void HdfsFileReader::GetHdfsStatistics(hdfsFile hdfs_file, bool log_stats) {
406 struct hdfsReadStatistics* stats;
407 if (IsHdfsPath(scan_range_->file())) {
408 int success = hdfsFileGetReadStatistics(hdfs_file, &stats);
409 if (success == 0) {
410 scan_range_->reader_->bytes_read_local_.Add(stats->totalLocalBytesRead);
411 scan_range_->reader_->bytes_read_short_circuit_.Add(
412 stats->totalShortCircuitBytesRead);
413 scan_range_->reader_->bytes_read_dn_cache_.Add(stats->totalZeroCopyBytesRead);
414 if (stats->totalLocalBytesRead != stats->totalBytesRead) {
415 num_remote_bytes_ += stats->totalBytesRead - stats->totalLocalBytesRead;
416 }
417 if (log_stats) {
418 LOG(INFO) << "Stats for last read by this I/O thread:"
419 << " totalBytesRead=" << stats->totalBytesRead
420 << " totalLocalBytesRead=" << stats->totalLocalBytesRead
421 << " totalShortCircuitBytesRead=" << stats->totalShortCircuitBytesRead
422 << " totalZeroCopyBytesRead=" << stats->totalZeroCopyBytesRead;
423 }
424 hdfsFileFreeReadStatistics(stats);
425 }
426 hdfsFileClearReadStatistics(hdfs_file);
427 }
428}
429
430void HdfsFileReader::ResetState() {
431 FileReader::ResetState();

Callers

nothing calls this directly

Calls 3

IsHdfsPathFunction · 0.85
fileMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected