Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion velox/common/caching/AsyncDataCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class CoalescedLoad {
return state_;
}

void cancel() {
virtual void cancel() {
setEndState(State::kCancelled);
}

Expand Down
11 changes: 11 additions & 0 deletions velox/dwio/common/DirectBufferedInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ class DirectCoalescedLoad : public cache::CoalescedLoad {
return size;
}

void cancel() override {
folly::SemiFuture<bool> waitFuture(false);
if (state() == State::kLoading && !loadOrFuture(&waitFuture)) {
waitFuture.wait();
}
for (auto& request : requests_) {
pool_->freeNonContiguous(request.data);
}
CoalescedLoad::cancel();
}

private:
const std::shared_ptr<IoStatistics> ioStats_;
const std::shared_ptr<filesystems::File::IoStats> fsStats_;
Expand Down