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

Spark: Use UUIDUtil.convertToByteBuffer to avoid rewinding buffer #7525

Merged
merged 1 commit into from
May 8, 2023

Conversation

nastra
Copy link
Contributor

@nastra nastra commented May 4, 2023

No description provided.

Copy link
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

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

My only nit is that we never want to directly call ByteBuffer#array(). We could replace that with ByteBuffers.toByteArray but we control the incoming buffer and know that it is always safe to call array() and use it without offsets. I think the only thing I'd change here is adding a comment that says something like "Calling array() is safe because the buffer is always allocated by the thread-local".

@nastra
Copy link
Contributor Author

nastra commented May 4, 2023

Agreed, it makes sense @rdblue to add a comment. I've done that and re-pushed. Thanks for reviewing

@nastra
Copy link
Contributor Author

nastra commented May 8, 2023

thanks for the review @rdblue, I've added a comment to make this clearer.

@nastra nastra merged commit fbdbaec into apache:master May 8, 2023
41 checks passed
@nastra nastra deleted the spark-uuid-improvements branch May 8, 2023 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants