Commit f7daa9b7 authored by TousakaRin's avatar TousakaRin

Fix code style: change name of getter function from MaxConcurrency() to max_concurrency()

parent 4987181a
......@@ -44,7 +44,7 @@ public:
// Returns the current maximum concurrency. Note that the maximum
// concurrency of some ConcurrencyLimiters(eg: `auto', `gradient')
// is dynamically changing.
int MaxConcurrency() { return _max_concurrency; };
int max_concurrency() { return _max_concurrency; };
// Expose internal vars. NOT thread-safe.
// Return 0 on success, -1 otherwise.
......
......@@ -59,7 +59,7 @@ public:
if (NULL == _cl) {
return 0;
} else {
return _cl->MaxConcurrency();
return _cl->max_concurrency();
}
}
......
......@@ -392,7 +392,7 @@ void ProcessRpcRequest(InputMessageBase* msg_base) {
if (!server_accessor.AddConcurrency(cntl.get())) {
cntl->SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
......
......@@ -1187,7 +1187,7 @@ void ProcessHttpRequest(InputMessageBase *msg) {
}
if (!server_accessor.AddConcurrency(cntl.get())) {
cntl->SetFailed(ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
return SendHttpResponse(cntl.release(), server, method_status, msg->received_us());
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -424,7 +424,7 @@ void ProcessHuluRequest(InputMessageBase* msg_base) {
if (!server_accessor.AddConcurrency(cntl.get())) {
cntl->SetFailed(ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -222,7 +222,7 @@ void ProcessMongoRequest(InputMessageBase* msg_base) {
if (!ServerPrivateAccessor(server).AddConcurrency(&(mongo_done->cntl))) {
mongo_done->cntl.SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -294,7 +294,7 @@ void ProcessNsheadRequest(InputMessageBase* msg_base) {
if (!server_accessor.AddConcurrency(cntl)) {
cntl->SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -388,7 +388,7 @@ void ProcessSofaRequest(InputMessageBase* msg_base) {
if (!server_accessor.AddConcurrency(cntl.get())) {
cntl->SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -523,7 +523,7 @@ void ProcessThriftRequest(InputMessageBase* msg_base) {
}
if (!server_accessor.AddConcurrency(cntl)) {
cntl->SetFailed(ELIMIT, "Reached server's max_concurrency=%d",
server->MaxConcurrency());
server->max_concurrency());
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -1985,9 +1985,9 @@ int Server::ResetMaxConcurrency(int max_concurrency) {
return 0;
}
int Server::MaxConcurrency() const {
int Server::max_concurrency() const {
if (NULL != _cl) {
return _cl->MaxConcurrency();
return _cl->max_concurrency();
} else {
return g_default_max_concurrency_of_method;
}
......@@ -1998,7 +1998,6 @@ AdaptiveMaxConcurrency& Server::MaxConcurrencyOf(MethodProperty* mp) {
LOG(WARNING) << "MaxConcurrencyOf is only allowd before Server started";
return g_default_max_concurrency_of_method;
}
//TODO
if (mp->status == NULL) {
LOG(ERROR) << "method=" << mp->method->full_name()
<< " does not support max_concurrency";
......
......@@ -489,7 +489,7 @@ public:
int ResetMaxConcurrency(int max_concurrency);
// Server's current max concurrency
int MaxConcurrency() const;
int max_concurrency() const;
// Get/set max_concurrency associated with a method.
// Example:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment