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
cc381578
Commit
cc381578
authored
Apr 11, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revived_from_all_failed: remove unnecessary logs and comments
parent
2b550fd0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
12 deletions
+4
-12
circuit_breaker.cpp
src/brpc/circuit_breaker.cpp
+0
-2
cluster_recover_policy.h
src/brpc/cluster_recover_policy.h
+1
-2
randomized_load_balancer.cpp
src/brpc/policy/randomized_load_balancer.cpp
+0
-4
randomized_load_balancer.h
src/brpc/policy/randomized_load_balancer.h
+0
-1
brpc_load_balancer_unittest.cpp
test/brpc_load_balancer_unittest.cpp
+3
-3
No files found.
src/brpc/circuit_breaker.cpp
View file @
cc381578
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <butil/time.h>
#include <butil/time.h>
#include "brpc/circuit_breaker.h"
#include "brpc/circuit_breaker.h"
#include "brpc/errno.pb.h"
#include "butil/logging.h"
namespace
brpc
{
namespace
brpc
{
...
...
src/brpc/cluster_recover_policy.h
View file @
cc381578
...
@@ -75,8 +75,7 @@ private:
...
@@ -75,8 +75,7 @@ private:
int64_t
_usable_cache_time_ms
;
int64_t
_usable_cache_time_ms
;
};
};
// Return a DefaultClusterRecoverPolicy object by params. The caller is responsible
// Return a DefaultClusterRecoverPolicy object by params.
// for memory management of the return value.
bool
GetRecoverPolicyByParams
(
const
butil
::
StringPiece
&
params
,
bool
GetRecoverPolicyByParams
(
const
butil
::
StringPiece
&
params
,
std
::
shared_ptr
<
ClusterRecoverPolicy
>*
ptr_out
);
std
::
shared_ptr
<
ClusterRecoverPolicy
>*
ptr_out
);
...
...
src/brpc/policy/randomized_load_balancer.cpp
View file @
cc381578
...
@@ -31,10 +31,6 @@ inline uint32_t GenRandomStride() {
...
@@ -31,10 +31,6 @@ inline uint32_t GenRandomStride() {
return
prime_offset
[
butil
::
fast_rand_less_than
(
ARRAY_SIZE
(
prime_offset
))];
return
prime_offset
[
butil
::
fast_rand_less_than
(
ARRAY_SIZE
(
prime_offset
))];
}
}
RandomizedLoadBalancer
::
RandomizedLoadBalancer
()
:
_cluster_recover_policy
(
NULL
)
{}
bool
RandomizedLoadBalancer
::
Add
(
Servers
&
bg
,
const
ServerId
&
id
)
{
bool
RandomizedLoadBalancer
::
Add
(
Servers
&
bg
,
const
ServerId
&
id
)
{
if
(
bg
.
server_list
.
capacity
()
<
128
)
{
if
(
bg
.
server_list
.
capacity
()
<
128
)
{
bg
.
server_list
.
reserve
(
128
);
bg
.
server_list
.
reserve
(
128
);
...
...
src/brpc/policy/randomized_load_balancer.h
View file @
cc381578
...
@@ -31,7 +31,6 @@ namespace policy {
...
@@ -31,7 +31,6 @@ namespace policy {
// than RoundRobinLoadBalancer.
// than RoundRobinLoadBalancer.
class
RandomizedLoadBalancer
:
public
LoadBalancer
{
class
RandomizedLoadBalancer
:
public
LoadBalancer
{
public
:
public
:
RandomizedLoadBalancer
();
bool
AddServer
(
const
ServerId
&
id
);
bool
AddServer
(
const
ServerId
&
id
);
bool
RemoveServer
(
const
ServerId
&
id
);
bool
RemoveServer
(
const
ServerId
&
id
);
size_t
AddServersInBatch
(
const
std
::
vector
<
ServerId
>&
servers
);
size_t
AddServersInBatch
(
const
std
::
vector
<
ServerId
>&
servers
);
...
...
test/brpc_load_balancer_unittest.cpp
View file @
cc381578
...
@@ -790,13 +790,13 @@ TEST_F(LoadBalancerTest, health_check_no_valid_server) {
...
@@ -790,13 +790,13 @@ TEST_F(LoadBalancerTest, health_check_no_valid_server) {
TEST_F
(
LoadBalancerTest
,
revived_from_all_failed_sanity
)
{
TEST_F
(
LoadBalancerTest
,
revived_from_all_failed_sanity
)
{
brpc
::
LoadBalancer
*
lb
=
NULL
;
brpc
::
LoadBalancer
*
lb
=
NULL
;
// TODO(zhujiashun)
int
rand
=
butil
::
fast_rand_less_than
(
2
);
int
rand
=
butil
::
fast_rand_less_than
(
1
);
if
(
rand
==
0
)
{
if
(
rand
==
0
)
{
brpc
::
policy
::
RandomizedLoadBalancer
rlb
;
brpc
::
policy
::
RandomizedLoadBalancer
rlb
;
lb
=
rlb
.
New
(
"minimum_working_instances=2 hold_time_ms=2000"
);
lb
=
rlb
.
New
(
"minimum_working_instances=2 hold_time_ms=2000"
);
}
else
if
(
rand
==
1
)
{
}
else
if
(
rand
==
1
)
{
lb
=
new
brpc
::
policy
::
RoundRobinLoadBalancer
;
brpc
::
policy
::
RoundRobinLoadBalancer
rrlb
;
lb
=
rrlb
.
New
(
"minimum_working_instances=2 hold_time_ms=2000"
);
}
}
brpc
::
SocketUniquePtr
ptr
[
2
];
brpc
::
SocketUniquePtr
ptr
[
2
];
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
servers
);
++
i
)
{
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
servers
);
++
i
)
{
...
...
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