@@ -34,7 +34,7 @@ bool RPCClient::AsyncSendVariable(const std::string& ep,
34
34
const std::string ep_val = ep;
35
35
const std::string var_name_val = var_name;
36
36
const framework::Scope* p_scope = &scope;
37
- const auto ch = GetChannel (ep_val, ep_val + " : " + var_name_val );
37
+ const auto ch = GetChannel (ep_val);
38
38
39
39
framework::AsyncIO ([var_name_val, p_ctx, ep_val, p_scope, time_out, ch,
40
40
this ] {
@@ -88,7 +88,7 @@ bool RPCClient::AsyncGetVariable(const std::string& ep,
88
88
const std::string ep_val = ep;
89
89
const std::string var_name_val = var_name;
90
90
const framework::Scope* p_scope = &scope;
91
- const auto ch = GetChannel (ep_val, ep_val + " : " + var_name_val );
91
+ const auto ch = GetChannel (ep_val);
92
92
93
93
framework::AsyncIO ([var_name_val, ep_val, p_scope, p_ctx, time_out, ch,
94
94
this ] {
@@ -132,7 +132,7 @@ bool RPCClient::AsyncPrefetchVariable(const std::string& ep,
132
132
const std::string in_var_name_val = in_var_name;
133
133
const std::string out_var_name_val = out_var_name;
134
134
const framework::Scope* p_scope = &scope;
135
- const auto ch = GetChannel (ep_val, ep_val + " : " + in_var_name_val );
135
+ const auto ch = GetChannel (ep_val);
136
136
137
137
framework::AsyncIO ([in_var_name_val, out_var_name_val, ep_val, p_scope, p_ctx,
138
138
time_out, ch, this ] {
@@ -165,7 +165,7 @@ bool RPCClient::AsyncPrefetchVariable(const std::string& ep,
165
165
}
166
166
167
167
void RPCClient::AsyncSendBatchBarrier (const std::string& ep, int64_t time_out) {
168
- const auto ch = GetChannel (ep, ep );
168
+ const auto ch = GetChannel (ep);
169
169
170
170
BatchBarrierProcessor* s = new BatchBarrierProcessor (ch);
171
171
s->Prepare (time_out);
@@ -178,7 +178,7 @@ void RPCClient::AsyncSendBatchBarrier(const std::string& ep, int64_t time_out) {
178
178
}
179
179
180
180
void RPCClient::AsyncSendFetchBarrier (const std::string& ep, int64_t time_out) {
181
- const auto ch = GetChannel (ep, ep );
181
+ const auto ch = GetChannel (ep);
182
182
FetchBarrierProcessor* s = new FetchBarrierProcessor (ch);
183
183
s->Prepare (time_out);
184
184
@@ -248,10 +248,9 @@ bool RPCClient::Proceed() {
248
248
delete c;
249
249
return true ;
250
250
}
251
- std::shared_ptr<grpc::Channel> RPCClient::GetChannel (const std::string& ep,
252
- const std::string& key) {
251
+ std::shared_ptr<grpc::Channel> RPCClient::GetChannel (const std::string& ep) {
253
252
std::unique_lock<std::mutex> lock (mutex_);
254
- auto it = channels_.find (key );
253
+ auto it = channels_.find (ep );
255
254
if (it != channels_.end ()) {
256
255
return it->second ;
257
256
}
@@ -263,7 +262,7 @@ std::shared_ptr<grpc::Channel> RPCClient::GetChannel(const std::string& ep,
263
262
264
263
auto ch =
265
264
grpc::CreateCustomChannel (ep, grpc::InsecureChannelCredentials (), args);
266
- channels_[key ] = ch;
265
+ channels_[ep ] = ch;
267
266
return ch;
268
267
}
269
268
0 commit comments