-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add coordinator connection reusing #6179
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
Conversation
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.
Review completed. 2 suggestions posted.
Comment augment review to trigger a new review at any time.
a897b5e to
e778a76
Compare
src/server/take_resp_expr.h
Outdated
| class TakeRespExpr { | ||
| 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.
- Take is a verb, its better to be Taken or Owned
- Is it temporary? Why a new class? Why in /server?
RespExpr isn't much used besides the connection code (and tests), maybe you can modify the original one to have an owned buffer?
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.
I've added it here because of protocol client
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.
for further developement we need better command parsing approach and I think it will be more code, maybe I will create a separate directory and move this code there.
src/server/protocol_client.cc
Outdated
| return res; | ||
| } | ||
|
|
||
| io::Result<TakeRespExpr::Vec> ProtocolClient::TakeRespReply(base::IoBuf* buffer, bool copy_msg) { |
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.
its the same as ReadRespExpr except some small details. If this code is not temporary, please keep it as one function. Futhermore, if you extend RespExpr to be owning, you can pass it just as a parameter without any templates
e778a76 to
d74ef3a
Compare
d74ef3a to
b3f6299
Compare
dranikpg
left a comment
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.
I'm not going to force my opinion on you any further but it seems like the separate type is redundant
| using Vec = std::vector<OwnedRespExpr>; | ||
| Type type; | ||
|
|
||
| std::variant<int64_t, double, Buffer, Vec> u; |
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.
I still don't understand why you can't extedn RespExpr with an OwnedBuffer type and then adapt TakeRespReply to conditionally use either of those
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.
will do in one of the next PRs
related to #6009
Added coordinator connection reusing