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
c10ea28e
Commit
c10ea28e
authored
Jul 26, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete method MethodStatus::max_concurrency_ref()
parent
93ba5e32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
20 deletions
+3
-20
concurrency_limiter.cpp
src/brpc/concurrency_limiter.cpp
+1
-1
method_status.cpp
src/brpc/details/method_status.cpp
+0
-16
method_status.h
src/brpc/details/method_status.h
+1
-2
server_private_accessor.h
src/brpc/details/server_private_accessor.h
+1
-1
No files found.
src/brpc/concurrency_limiter.cpp
View file @
c10ea28e
...
@@ -28,7 +28,7 @@ ConcurrencyLimiter* ConcurrencyLimiter::CreateConcurrencyLimiterOrDie(
...
@@ -28,7 +28,7 @@ ConcurrencyLimiter* ConcurrencyLimiter::CreateConcurrencyLimiterOrDie(
ConcurrencyLimiter
*
cl_copy
=
cl
->
New
();
ConcurrencyLimiter
*
cl_copy
=
cl
->
New
();
CHECK
(
cl_copy
!=
NULL
)
<<
"Fail to new ConcurrencyLimiter"
;
CHECK
(
cl_copy
!=
NULL
)
<<
"Fail to new ConcurrencyLimiter"
;
if
(
max_concurrency
==
"constant"
)
{
if
(
max_concurrency
==
"constant"
)
{
cl_copy
->
SetMaxConcurrency
(
max_concurrency
)
;
cl_copy
->
_max_concurrency
=
max_concurrency
;
}
}
return
cl_copy
;
return
cl_copy
;
}
}
...
...
src/brpc/details/method_status.cpp
View file @
c10ea28e
...
@@ -127,22 +127,6 @@ void MethodStatus::Describe(
...
@@ -127,22 +127,6 @@ void MethodStatus::Describe(
_nprocessing
,
options
,
false
);
_nprocessing
,
options
,
false
);
}
}
int
&
MethodStatus
::
max_concurrency_ref
()
{
if
(
NULL
==
_cl
)
{
const
ConcurrencyLimiter
*
cl
=
ConcurrencyLimiterExtension
()
->
Find
(
"constant"
);
if
(
NULL
==
cl
)
{
LOG
(
FATAL
)
<<
"Fail to find ConcurrentLimiter by `constant`"
;
}
ConcurrencyLimiter
*
cl_copy
=
cl
->
New
();
if
(
NULL
==
cl_copy
)
{
LOG
(
FATAL
)
<<
"Fail to new ConcurrencyLimiter"
;
}
_cl
=
cl_copy
;
}
return
_cl
->
MaxConcurrencyRef
();
}
void
MethodStatus
::
SetConcurrencyLimiter
(
ConcurrencyLimiter
*
cl
)
{
void
MethodStatus
::
SetConcurrencyLimiter
(
ConcurrencyLimiter
*
cl
)
{
if
(
NULL
!=
_cl
)
{
if
(
NULL
!=
_cl
)
{
_cl
->
Destroy
();
_cl
->
Destroy
();
...
...
src/brpc/details/method_status.h
View file @
c10ea28e
...
@@ -68,9 +68,8 @@ friend class ScopedMethodStatus;
...
@@ -68,9 +68,8 @@ friend class ScopedMethodStatus;
friend
class
Server
;
friend
class
Server
;
DISALLOW_COPY_AND_ASSIGN
(
MethodStatus
);
DISALLOW_COPY_AND_ASSIGN
(
MethodStatus
);
// Note:
Following methods are
not thread safe and can only be called
// Note:
SetConcurrencyLimiter() is
not thread safe and can only be called
// before the server is started.
// before the server is started.
int
&
max_concurrency_ref
();
void
SetConcurrencyLimiter
(
ConcurrencyLimiter
*
cl
);
void
SetConcurrencyLimiter
(
ConcurrencyLimiter
*
cl
);
ConcurrencyLimiter
*
_cl
;
ConcurrencyLimiter
*
_cl
;
...
...
src/brpc/details/server_private_accessor.h
View file @
c10ea28e
...
@@ -49,7 +49,7 @@ public:
...
@@ -49,7 +49,7 @@ public:
void
RemoveConcurrency
(
const
Controller
*
c
)
{
void
RemoveConcurrency
(
const
Controller
*
c
)
{
if
(
c
->
has_flag
(
Controller
::
FLAGS_ADDED_CONCURRENCY
)){
if
(
c
->
has_flag
(
Controller
::
FLAGS_ADDED_CONCURRENCY
)){
CHECK
(
_server
->
_cl
!=
NULL
)
CHECK
(
_server
->
_cl
!=
NULL
)
;
_server
->
_cl
->
OnResponded
(
c
->
ErrorCode
(),
c
->
latency_us
());
_server
->
_cl
->
OnResponded
(
c
->
ErrorCode
(),
c
->
latency_us
());
}
}
}
}
...
...
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