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

Method start

src/runtime/service_engine.cpp:114–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114error_code service_node::start()
115{
116 error_code err = ERR_OK;
117
118 // init data dir
119 if (!dsn::utils::filesystem::path_exists(spec().data_dir))
120 dsn::utils::filesystem::create_directory(spec().data_dir);
121
122 // init task engine
123 _computation = std::make_unique<task_engine>(this);
124 _computation->create(_app_spec.pools);
125 CHECK(!_computation->is_started(), "task engine must not be started at this point");
126
127 // init rpc
128 err = init_rpc_engine();
129 if (err != ERR_OK)
130 return err;
131
132 // start task engine
133 _computation->start();
134 CHECK(_computation->is_started(), "task engine must be started at this point");
135
136 // create service_app
137 {
138 ::dsn::tools::node_scoper scoper(this);
139 init_service_app();
140 }
141
142 // start rpc serving
143 _rpc->start_serving();
144
145 return err;
146}
147
148void service_node::get_runtime_info(const std::string &indent,
149 const std::vector<std::string> &args,

Callers 3

init_rpc_engineMethod · 0.45
start_appMethod · 0.45
start_nodeMethod · 0.45

Calls 5

path_existsFunction · 0.85
create_directoryFunction · 0.85
start_servingMethod · 0.80
createMethod · 0.65
is_startedMethod · 0.45

Tested by

no test coverage detected