Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
f7daa9b7
Commit
f7daa9b7
authored
Aug 01, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style: change name of getter function from MaxConcurrency() to max_concurrency()
parent
4987181a
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
12 additions
and
13 deletions
+12
-13
concurrency_limiter.h
src/brpc/concurrency_limiter.h
+1
-1
method_status.h
src/brpc/details/method_status.h
+1
-1
baidu_rpc_protocol.cpp
src/brpc/policy/baidu_rpc_protocol.cpp
+1
-1
http_rpc_protocol.cpp
src/brpc/policy/http_rpc_protocol.cpp
+1
-1
hulu_pbrpc_protocol.cpp
src/brpc/policy/hulu_pbrpc_protocol.cpp
+1
-1
mongo_protocol.cpp
src/brpc/policy/mongo_protocol.cpp
+1
-1
nshead_protocol.cpp
src/brpc/policy/nshead_protocol.cpp
+1
-1
sofa_pbrpc_protocol.cpp
src/brpc/policy/sofa_pbrpc_protocol.cpp
+1
-1
thrift_protocol.cpp
src/brpc/policy/thrift_protocol.cpp
+1
-1
server.cpp
src/brpc/server.cpp
+2
-3
server.h
src/brpc/server.h
+1
-1
No files found.
src/brpc/concurrency_limiter.h
View file @
f7daa9b7
...
@@ -44,7 +44,7 @@ public:
...
@@ -44,7 +44,7 @@ public:
// Returns the current maximum concurrency. Note that the maximum
// Returns the current maximum concurrency. Note that the maximum
// concurrency of some ConcurrencyLimiters(eg: `auto', `gradient')
// concurrency of some ConcurrencyLimiters(eg: `auto', `gradient')
// is dynamically changing.
// is dynamically changing.
int
MaxC
oncurrency
()
{
return
_max_concurrency
;
};
int
max_c
oncurrency
()
{
return
_max_concurrency
;
};
// Expose internal vars. NOT thread-safe.
// Expose internal vars. NOT thread-safe.
// Return 0 on success, -1 otherwise.
// Return 0 on success, -1 otherwise.
...
...
src/brpc/details/method_status.h
View file @
f7daa9b7
...
@@ -59,7 +59,7 @@ public:
...
@@ -59,7 +59,7 @@ public:
if
(
NULL
==
_cl
)
{
if
(
NULL
==
_cl
)
{
return
0
;
return
0
;
}
else
{
}
else
{
return
_cl
->
MaxC
oncurrency
();
return
_cl
->
max_c
oncurrency
();
}
}
}
}
...
...
src/brpc/policy/baidu_rpc_protocol.cpp
View file @
f7daa9b7
...
@@ -392,7 +392,7 @@ void ProcessRpcRequest(InputMessageBase* msg_base) {
...
@@ -392,7 +392,7 @@ void ProcessRpcRequest(InputMessageBase* msg_base) {
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
cntl
->
SetFailed
(
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
...
...
src/brpc/policy/http_rpc_protocol.cpp
View file @
f7daa9b7
...
@@ -1187,7 +1187,7 @@ void ProcessHttpRequest(InputMessageBase *msg) {
...
@@ -1187,7 +1187,7 @@ void ProcessHttpRequest(InputMessageBase *msg) {
}
}
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
return
SendHttpResponse
(
cntl
.
release
(),
server
,
method_status
,
msg
->
received_us
());
return
SendHttpResponse
(
cntl
.
release
(),
server
,
method_status
,
msg
->
received_us
());
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/policy/hulu_pbrpc_protocol.cpp
View file @
f7daa9b7
...
@@ -424,7 +424,7 @@ void ProcessHuluRequest(InputMessageBase* msg_base) {
...
@@ -424,7 +424,7 @@ void ProcessHuluRequest(InputMessageBase* msg_base) {
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/policy/mongo_protocol.cpp
View file @
f7daa9b7
...
@@ -222,7 +222,7 @@ void ProcessMongoRequest(InputMessageBase* msg_base) {
...
@@ -222,7 +222,7 @@ void ProcessMongoRequest(InputMessageBase* msg_base) {
if
(
!
ServerPrivateAccessor
(
server
).
AddConcurrency
(
&
(
mongo_done
->
cntl
)))
{
if
(
!
ServerPrivateAccessor
(
server
).
AddConcurrency
(
&
(
mongo_done
->
cntl
)))
{
mongo_done
->
cntl
.
SetFailed
(
mongo_done
->
cntl
.
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/policy/nshead_protocol.cpp
View file @
f7daa9b7
...
@@ -294,7 +294,7 @@ void ProcessNsheadRequest(InputMessageBase* msg_base) {
...
@@ -294,7 +294,7 @@ void ProcessNsheadRequest(InputMessageBase* msg_base) {
if
(
!
server_accessor
.
AddConcurrency
(
cntl
))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
))
{
cntl
->
SetFailed
(
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/policy/sofa_pbrpc_protocol.cpp
View file @
f7daa9b7
...
@@ -388,7 +388,7 @@ void ProcessSofaRequest(InputMessageBase* msg_base) {
...
@@ -388,7 +388,7 @@ void ProcessSofaRequest(InputMessageBase* msg_base) {
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
.
get
()))
{
cntl
->
SetFailed
(
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/policy/thrift_protocol.cpp
View file @
f7daa9b7
...
@@ -523,7 +523,7 @@ void ProcessThriftRequest(InputMessageBase* msg_base) {
...
@@ -523,7 +523,7 @@ void ProcessThriftRequest(InputMessageBase* msg_base) {
}
}
if
(
!
server_accessor
.
AddConcurrency
(
cntl
))
{
if
(
!
server_accessor
.
AddConcurrency
(
cntl
))
{
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
cntl
->
SetFailed
(
ELIMIT
,
"Reached server's max_concurrency=%d"
,
server
->
MaxC
oncurrency
());
server
->
max_c
oncurrency
());
break
;
break
;
}
}
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
if
(
FLAGS_usercode_in_pthread
&&
TooManyUserCode
())
{
...
...
src/brpc/server.cpp
View file @
f7daa9b7
...
@@ -1985,9 +1985,9 @@ int Server::ResetMaxConcurrency(int max_concurrency) {
...
@@ -1985,9 +1985,9 @@ int Server::ResetMaxConcurrency(int max_concurrency) {
return
0
;
return
0
;
}
}
int
Server
::
MaxC
oncurrency
()
const
{
int
Server
::
max_c
oncurrency
()
const
{
if
(
NULL
!=
_cl
)
{
if
(
NULL
!=
_cl
)
{
return
_cl
->
MaxC
oncurrency
();
return
_cl
->
max_c
oncurrency
();
}
else
{
}
else
{
return
g_default_max_concurrency_of_method
;
return
g_default_max_concurrency_of_method
;
}
}
...
@@ -1998,7 +1998,6 @@ AdaptiveMaxConcurrency& Server::MaxConcurrencyOf(MethodProperty* mp) {
...
@@ -1998,7 +1998,6 @@ AdaptiveMaxConcurrency& Server::MaxConcurrencyOf(MethodProperty* mp) {
LOG
(
WARNING
)
<<
"MaxConcurrencyOf is only allowd before Server started"
;
LOG
(
WARNING
)
<<
"MaxConcurrencyOf is only allowd before Server started"
;
return
g_default_max_concurrency_of_method
;
return
g_default_max_concurrency_of_method
;
}
}
//TODO
if
(
mp
->
status
==
NULL
)
{
if
(
mp
->
status
==
NULL
)
{
LOG
(
ERROR
)
<<
"method="
<<
mp
->
method
->
full_name
()
LOG
(
ERROR
)
<<
"method="
<<
mp
->
method
->
full_name
()
<<
" does not support max_concurrency"
;
<<
" does not support max_concurrency"
;
...
...
src/brpc/server.h
View file @
f7daa9b7
...
@@ -489,7 +489,7 @@ public:
...
@@ -489,7 +489,7 @@ public:
int
ResetMaxConcurrency
(
int
max_concurrency
);
int
ResetMaxConcurrency
(
int
max_concurrency
);
// Server's current max concurrency
// Server's current max concurrency
int
MaxC
oncurrency
()
const
;
int
max_c
oncurrency
()
const
;
// Get/set max_concurrency associated with a method.
// Get/set max_concurrency associated with a method.
// Example:
// Example:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment