Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getSizeInBytes rather than getRetainedSizeInBytes #21653

Merged
merged 1 commit into from
Apr 22, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ private long sendPageToPartition(Consumer<Page> buffer, Page pageSplit)
long retainedSizeInBytes = pageSplit.getRetainedSizeInBytes();
memoryManager.updateMemoryUsage(retainedSizeInBytes);
buffer.accept(pageSplit);
return retainedSizeInBytes;
return pageSplit.getSizeInBytes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong about the existing code ?
We're calling page.compact() or page.copyPositions before sendPageToPartition, so what difference will this change make ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRetainedSizeInBytes does not equal getSizeInBytes after compact or copyPositions. An example is dictionary. getSizeInBytes was always used to measure flow of data

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just about measuring data processed, then why don't we call getSizeInBytes once on the full Page before splitting it rather than calling it on each partitioned Page and then adding that up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, #21668

}
}