MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / start_node

Method start_node

src/runtime/service_engine.cpp:218–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void service_engine::start_node(service_app_spec &app_spec)
219{
220 std::unordered_map<int, std::string> app_name_by_port;
221 auto it = _nodes_by_app_id.find(app_spec.id);
222 if (it == _nodes_by_app_id.end()) {
223 for (auto p : app_spec.ports) {
224 // union to existing node if any port is shared
225 auto it = app_name_by_port.find(p);
226 if (it != app_name_by_port.end()) {
227 CHECK(false,
228 "network port {} usage confliction for {} vs {}, "
229 "please reconfig",
230 p,
231 it->second,
232 app_spec.full_name);
233 }
234 app_name_by_port.emplace(p, app_spec.full_name);
235 }
236
237 auto node = std::make_shared<service_node>(app_spec);
238 error_code err = node->start();
239 CHECK_EQ_MSG(err, ERR_OK, "service node start failed");
240
241 _nodes_by_app_id[node->id()] = node;
242 }
243}
244
245std::string service_engine::get_runtime_info(const std::vector<std::string> &args)
246{

Callers 1

runFunction · 0.80

Calls 5

findMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45
startMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected