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

[Improvement] We should use buffer method instead heapBuffer #2275

Open
2 of 3 tasks
jerqi opened this issue Dec 5, 2024 · 3 comments
Open
2 of 3 tasks

[Improvement] We should use buffer method instead heapBuffer #2275

jerqi opened this issue Dec 5, 2024 · 3 comments

Comments

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2024

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

What would you like to be improved?

Spark code use buffer instead heapBuffer.

image

How should we improve?

We should use buffer method instead heapBuffer

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@jerqi
Copy link
Contributor Author

jerqi commented Dec 5, 2024

cc @maobaolong @rickyma

@maobaolong
Copy link
Member

I think it should be ByteBuf header = ctx.alloc().directBuffer(headerLength);

@rickyma
Copy link
Contributor

rickyma commented Dec 6, 2024

We can use DirectBuffer, but we need to release the bytebuf manually.
The length of the header is not large, so it is acceptable to use HeapBuffer.

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

No branches or pull requests

3 participants