Skip to content

Avoid unnecessary copies of Thrift binary types#6459

Open
ctubbsii wants to merge 1 commit into
apache:mainfrom
ctubbsii:fix-thrift-binaries
Open

Avoid unnecessary copies of Thrift binary types#6459
ctubbsii wants to merge 1 commit into
apache:mainfrom
ctubbsii:fix-thrift-binaries

Conversation

@ctubbsii

@ctubbsii ctubbsii commented Jul 1, 2026

Copy link
Copy Markdown
Member

No description provided.

@ctubbsii ctubbsii added this to the 4.0.0 milestone Jul 1, 2026
@ctubbsii ctubbsii self-assigned this Jul 1, 2026
@DomGarguilo

Copy link
Copy Markdown
Member

In #6430, I suggested ByteBufferUtil because it preserved the original behavior: the old code read from ByteBuffer fields and made defensive copies. Without that, the new object may reuse Thrift’s internal byte array, so changes to the Thrift object could also change the constructed Key/Column/Mutation.

That being said, if it doesn't seem like that is an issue here, I think this is a good fix for the mentioned issue we are seeing.

@ctubbsii ctubbsii removed this from the 4.0.0 milestone Jul 2, 2026
@ctubbsii

ctubbsii commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Closing due to discussion on #6455 ; I didn't realize the getter was also calling the setter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants