MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ChannelCacheFactory

Method ChannelCacheFactory

tensorflow/contrib/verbs/verbs_server_lib.cc:51–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51Status VerbsServer::ChannelCacheFactory(const ServerDef& server_def,
52 GrpcChannelCache** channel_cache) {
53 string name_prefix =
54 strings::StrCat("/job:", server_def.job_name(), "/replica:0",
55 "/task:", server_def.task_index());
56
57 GrpcChannelSpec channel_spec;
58 TF_RETURN_IF_ERROR(ParseChannelSpec(server_def, &channel_spec));
59
60 *channel_cache =
61 NewGrpcChannelCache(channel_spec, GetChannelCreationFunction());
62
63 const string host_port = (*channel_cache)->TranslateTask(name_prefix);
64 int requested_port;
65
66 if (!strings::safe_strto32(str_util::Split(host_port, ':')[1],
67 &requested_port)) {
68 return errors::Internal("Could not parse port for local server from \"",
69 (*channel_cache)->TranslateTask(name_prefix),
70 "\".");
71 }
72 if (requested_port != bound_port()) {
73 return errors::InvalidArgument("Requested port ", requested_port,
74 " differs from expected port ",
75 bound_port());
76 }
77
78 return Status::OK();
79}
80
81Status VerbsServer::Init(ServiceInitFunction service_func,
82 RendezvousMgrCreationFunction rendezvous_mgr_func) {

Callers

nothing calls this directly

Calls 9

NewGrpcChannelCacheFunction · 0.85
InternalFunction · 0.85
InvalidArgumentFunction · 0.85
job_nameMethod · 0.80
task_indexMethod · 0.80
StrCatFunction · 0.50
safe_strto32Function · 0.50
SplitFunction · 0.50
TranslateTaskMethod · 0.45

Tested by

no test coverage detected