| 403 | } |
| 404 | |
| 405 | void 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 | |
| 430 | void HdfsFileReader::ResetState() { |
| 431 | FileReader::ResetState(); |
nothing calls this directly
no test coverage detected