Skip to content

Commit

Permalink
Add getRetainedBytes to Vader Writers
Browse files Browse the repository at this point in the history
Summary: Expose retained bytes method for Vader writers. This will be used to keep track of the maximum amount of memory consumed by the writers when creating synthetic metalake updates [[here]](https://fburl.com/code/vi67aqad) and [[here]](https://fburl.com/code/dyxc40n1).

Reviewed By: sdruzkin

Differential Revision: D66686627
  • Loading branch information
MacVincent Agha-Oko authored and facebook-github-bot committed Dec 27, 2024
1 parent fae485b commit 7fbe64e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dwio/nimble/velox/VeloxWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,4 +868,8 @@ VeloxWriter::RunStats VeloxWriter::getRunStats() const {
.inputBufferReallocItemCount =
context_->inputBufferGrowthStats.itemCount};
}

int64_t VeloxWriter::getPeakMemoryUsage() const {
return writerMemoryPool_->peakBytes();
}
} // namespace facebook::nimble
2 changes: 2 additions & 0 deletions dwio/nimble/velox/VeloxWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class VeloxWriter {

RunStats getRunStats() const;

int64_t getPeakMemoryUsage() const;

private:
std::shared_ptr<const velox::dwio::common::TypeWithId> schema_;
std::unique_ptr<velox::WriteFile> file_;
Expand Down

0 comments on commit 7fbe64e

Please sign in to comment.