-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-28613 Use streaming when marshalling protobuf REST output #5943
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a minor comment added.
// The Jetty 9.4 HttpOutput default commit size is 32K/4 = 8K. We use that size to avoid | ||
// double buffering (and copying) in HttpOutput. If we ever increase the HttpOutput commit size, | ||
// we need to adjust this accordingly. We should also revisit this when Jetty is upgraded. | ||
static final int BUFFER_SIZE = 8 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: static/final is redundant as all the fields in an interface are implicitly static/final/public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, fixed.
return messageFromObject().toByteArray(); | ||
} | ||
|
||
public Message messageFromObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Modifier 'public' is also redundant for interface members. It can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, fixed.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
default byte[] createProtobufOutput() { | ||
return messageFromObject().toByteArray(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this will not be used anywhere? Should we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While being marked as Interfacetype.PRIVATE, this is in fact used by all tests, and has to be used by client code as well.
If we removed this, we'd have to change all protobuf tests, and all existing client code using protobuf would have to be rewritten.
Ideally, we'd have some kind of public interface for marshalling/unmarshalling the REST structures client side, or we'd have them hooked up to the rest framework client code, but we don't.
The existing REST Client class relies on passing marshalled byte arrays everywhere. There may be a way to provide a more elegant Jax-RS based client, but that would only apply to new clients.
Signed-off-by: Ankit Singhal <ankit@apache.org> (cherry picked from commit d1d8b4d)
Signed-off-by: Ankit Singhal <ankit@apache.org> (cherry picked from commit d1d8b4d)
Signed-off-by: Ankit Singhal <ankit@apache.org> (cherry picked from commit d1d8b4d)
Signed-off-by: Ankit Singhal <ankit@apache.org> (cherry picked from commit d1d8b4d)
No description provided.