-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
comment the graph::session module (Part 1) #3878
comment the graph::session module (Part 1) #3878
Conversation
src/graph/session/ClientSession.cpp
Outdated
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
// Copyright (c) 2020 vesoft inc. All rights reserved. | ||
|
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.
Add //
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.
👌
a8c9c3f
to
6082fe6
Compare
7065657
to
344bd32
Compare
src/graph/session/ClientSession.h
Outdated
@@ -23,8 +23,15 @@ struct SpaceInfo { | |||
meta::cpp2::SpaceDesc spaceDesc; | |||
}; | |||
|
|||
// A ClientSession is equivalent to a connection between a client and a server. |
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.
Session is not equivalent to connection. E.G. session could be saved in cluster even after connection broken.
class ClientSession final { | ||
public: | ||
// Creates a new ClientSession. | ||
// session: session obj used in RPC. | ||
// metaClient: used to communicate with meta server. |
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.
Add The information of session will be persisted in meta server.
@@ -143,7 +144,8 @@ void GraphSessionManager::removeSession(SessionID id) { | |||
return; | |||
} | |||
|
|||
iter->second->markAllQueryKilled(); | |||
iter->second->markAllQueryKilled(); // Before removing the session, all queries on the session |
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.
Put multiple-lines comment in front.
@@ -217,7 +219,8 @@ void GraphSessionManager::updateSessionsToMeta() { | |||
} | |||
} | |||
|
|||
auto handleKilledQueries = [this](auto&& resp) { | |||
auto handleKilledQueries = [this](auto&& resp) { // There may be expired queries, and the |
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.
ditto
*/ | ||
// Copyright (c) 2020 vesoft inc. All rights reserved. | ||
// | ||
// This source code is licensed under Apache 2.0 License. |
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.
why change the comment format? This changes maybe invalidate the license checker.
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.
This is the new comment requirement:
https://confluence.nebula-graph.io/pages/viewpage.action?pageId=35293986
The license check looks fine, it can pass.
src/graph/service/GraphService.cpp
Outdated
@@ -80,7 +80,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string& | |||
return future; | |||
} | |||
|
|||
if (!sessionManager_->isOutOfConnections()) { | |||
if (!sessionManager_->isWithinConnections()) { |
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.
prefer the previous function name.
src/graph/service/GraphService.cpp
Outdated
@@ -80,7 +80,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string& | |||
return future; | |||
} | |||
|
|||
if (!sessionManager_->isWithinConnections()) { | |||
if (!sessionManager_->isOutOfConnections()) { |
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.
You should keep isOutOfConnections
fit its name.
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.
yixinglu suggests isOutOfConnections prefer.
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 name of this function is obviously conflict with its implementation.
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.
Obviously, it should be:
if (isOutOfConnections) {
//report error
}
34fab66
to
0f1554f
Compare
* comment GraphSessionManager * comment ClientSession * modify_and_comment_session * comment * add more comment * fix comment * fix comment * fix comment
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
#3858
Description:
Just comment graph::session module.
How do you solve it?
Special notes for your reviewer, ex. impact of this fix, design document, etc:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe: