-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BOOKKEEPER-1018: Allow client to select older V2 protocol (no protobuf)
Originally done by Matteo Merli (merlimat). Tagging sijie and eolivelli for review. Author: Govind Menon <govindappumenon@gmail.com> Reviewers: Sijie Guo <sijie@apache.org> Closes #120 from govind-menon/BOOKKEEPER-1018
- Loading branch information
1 parent
9836c87
commit 9001e30
Showing
4 changed files
with
336 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9001e30
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.
Sorry for my very late reply
Some minor comments, maybe for future Jiras:
It seems to me or there is no testcase? How can we assert that all is workibg as expected?
The patch is quite straightforward but I'm worried about future changes. For instance the SSL patch.
@govind-menon . What is your use case? Do you have to connect to legacy bookies?
9001e30
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.
@eolivelli I knew a bit history about this. @merlimat mentioned to me that yahoo is using v2 protocol, since v2 protocol is more friendly with jvm gc.
@merlimat can you chime in when you have time?
9001e30
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.
The problem with the protobuf based protocol is that it creates a lot of throw-away objects for each serialization/deserialization cycle (that also is multiplied by the number of bookies a particular client is writing).
The bigger issue though, is that with protobuf the payload gets copied and allocated from JVM heap multiple times. That's kind of the design of protobuf, to be safe, but it comes at a high cost.
By using the v2 binary protocol, we can make the client and bookie avoid any payload copy and also perform serialization/deserialization with 0 allocated objects.
9001e30
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.
@eolivelli Thank you for your comments - I will add a test case.
@sijie Thanks for the review and merge
9001e30
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.
@govind-menon probably it would be good to just add a parameter so that existing tests are running on both protocols.
9001e30
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.
@merlimat Will do.