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
bc7165fb
Commit
bc7165fb
authored
Nov 28, 2019
by
jamesge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove fetch related methods from DiscoveryClient
parent
6f4dd466
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
27 deletions
+2
-27
discovery_naming_service.cpp
src/brpc/policy/discovery_naming_service.cpp
+0
-0
discovery_naming_service.h
src/brpc/policy/discovery_naming_service.h
+0
-9
sampler.cpp
src/bvar/detail/sampler.cpp
+2
-0
brpc_naming_service_unittest.cpp
test/brpc_naming_service_unittest.cpp
+0
-18
No files found.
src/brpc/policy/discovery_naming_service.cpp
View file @
bc7165fb
This diff is collapsed.
Click to expand it.
src/brpc/policy/discovery_naming_service.h
View file @
bc7165fb
...
@@ -41,14 +41,6 @@ struct DiscoveryRegisterParam {
...
@@ -41,14 +41,6 @@ struct DiscoveryRegisterParam {
bool
IsValid
()
const
;
bool
IsValid
()
const
;
};
};
struct
DiscoveryFetchsParam
{
std
::
string
appid
;
std
::
string
env
;
std
::
string
status
;
bool
IsValid
()
const
;
};
// ONE DiscoveryClient corresponds to ONE service instance.
// ONE DiscoveryClient corresponds to ONE service instance.
// If your program has multiple service instances to register,
// If your program has multiple service instances to register,
// you need multiple DiscoveryClient.
// you need multiple DiscoveryClient.
...
@@ -59,7 +51,6 @@ public:
...
@@ -59,7 +51,6 @@ public:
~
DiscoveryClient
();
~
DiscoveryClient
();
int
Register
(
const
DiscoveryRegisterParam
&
req
);
int
Register
(
const
DiscoveryRegisterParam
&
req
);
int
Fetchs
(
const
DiscoveryFetchsParam
&
req
,
std
::
vector
<
ServerNode
>*
servers
)
const
;
private
:
private
:
static
void
*
PeriodicRenew
(
void
*
arg
);
static
void
*
PeriodicRenew
(
void
*
arg
);
...
...
src/bvar/detail/sampler.cpp
View file @
bc7165fb
...
@@ -117,8 +117,10 @@ private:
...
@@ -117,8 +117,10 @@ private:
pthread_t
_tid
;
pthread_t
_tid
;
};
};
#ifndef UNIT_TEST
static
PassiveStatus
<
double
>*
s_cumulated_time_bvar
=
NULL
;
static
PassiveStatus
<
double
>*
s_cumulated_time_bvar
=
NULL
;
static
bvar
::
PerSecond
<
bvar
::
PassiveStatus
<
double
>
>*
s_sampling_thread_usage_bvar
=
NULL
;
static
bvar
::
PerSecond
<
bvar
::
PassiveStatus
<
double
>
>*
s_sampling_thread_usage_bvar
=
NULL
;
#endif
void
SamplerCollector
::
run
()
{
void
SamplerCollector
::
run
()
{
#ifndef UNIT_TEST
#ifndef UNIT_TEST
...
...
test/brpc_naming_service_unittest.cpp
View file @
bc7165fb
...
@@ -47,9 +47,6 @@ DECLARE_string(discovery_env);
...
@@ -47,9 +47,6 @@ DECLARE_string(discovery_env);
DECLARE_int32
(
discovery_renew_interval_s
);
DECLARE_int32
(
discovery_renew_interval_s
);
// Defined in discovery_naming_service.cpp
// Defined in discovery_naming_service.cpp
int
ParseFetchsResult
(
const
butil
::
IOBuf
&
buf
,
const
char
*
service_name
,
std
::
vector
<
brpc
::
ServerNode
>*
servers
);
int
ParseNodesResult
(
const
butil
::
IOBuf
&
buf
,
std
::
string
*
server_addr
);
int
ParseNodesResult
(
const
butil
::
IOBuf
&
buf
,
std
::
string
*
server_addr
);
}
// policy
}
// policy
...
@@ -534,21 +531,6 @@ static std::string s_nodes_result = R"({
...
@@ -534,21 +531,6 @@ static std::string s_nodes_result = R"({
})"
;
})"
;
TEST
(
NamingServiceTest
,
discovery_parse_function
)
{
std
::
vector
<
brpc
::
ServerNode
>
servers
;
brpc
::
policy
::
DiscoveryNamingService
dcns
;
butil
::
IOBuf
buf
;
buf
.
append
(
s_fetchs_result
);
ASSERT_EQ
(
0
,
brpc
::
policy
::
ParseFetchsResult
(
buf
,
"admin.test"
,
&
servers
));
ASSERT_EQ
((
size_t
)
1
,
servers
.
size
());
ASSERT_EQ
(
servers
[
0
].
tag
,
"{
\"
weight
\"
:
\"
10
\"
,
\"
cluster
\"
:
\"\"
}"
);
buf
.
clear
();
buf
.
append
(
s_nodes_result
);
std
::
string
server
;
ASSERT_EQ
(
0
,
brpc
::
policy
::
ParseNodesResult
(
buf
,
&
server
));
ASSERT_EQ
(
"127.0.0.1:8635"
,
server
);
}
class
DiscoveryNamingServiceImpl
:
public
test
::
DiscoveryNamingService
{
class
DiscoveryNamingServiceImpl
:
public
test
::
DiscoveryNamingService
{
public
:
public
:
DiscoveryNamingServiceImpl
()
DiscoveryNamingServiceImpl
()
...
...
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