Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JkSelf committed Jan 25, 2024
1 parent 50c5b7a commit c4b4e78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions velox/dwio/common/CacheInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ void CacheInputStream::loadPosition() {
// 'region_'
loadRegion.length = std::min<int32_t>(
loadQuantum_, region_.length - (loadRegion.offset - region_.offset));

// There is no need to update the metric in the loadData method because
// loadSync is always executed regardless and updates the metric.
loadSync(loadRegion);
}
auto* entry = pin_.checkedEntry();
Expand Down
3 changes: 3 additions & 0 deletions velox/dwio/common/DirectInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ void DirectInputStream::loadPosition() {
loadedRegion_.length = (offsetInRegion_ + loadQuantum_ <= region_.length)
? loadQuantum_
: (region_.length - offsetInRegion_);

// Since the loadSync method updates the metric, but it is conditionally
// executed, we also need to update the metric in the loadData method.
loadSync();
}

Expand Down

0 comments on commit c4b4e78

Please sign in to comment.