MCPcopy Create free account
hub / github.com/BabitMF/bmf / create_split_node

Function create_split_node

bmf/engine/c_engine/src/optimizer.cpp:281–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281NodeConfig create_split_node(int id, StreamConfig input_stream,
282 int scheduler, int dist_nums) {
283 nlohmann:json info;
284
285 info["id"] = id;
286 // info["alias"] = alias_;
287 info["module_info"] = {
288 {"entry", "split_module:SplitModule"},
289 {"name", "SplitModule"},
290 {"path", "libengine.so"},
291 {"type", "c++"}
292 };
293 // info["meta_info"] = {
294 // "callback_binding", []
295 // "premodule_id", 0
296 // };
297 info["input_streams"] = nlohmann::json::array();
298 info["input_streams"].push_back({
299 {"alias", input_stream.get_alias()},
300 {"identifier", input_stream.get_identifier()},
301 {"notify", input_stream.get_notify()}
302 });
303
304 for (int i = 0; i < dist_nums; i++) {
305 std::ostringstream output_identifier;
306 output_identifier << "split_module_" << id << "_" << i;
307
308 info["output_streams"].push_back({
309 {"alias", ""},
310 {"identifier", output_identifier.str()},
311 {"notify", ""}
312 });
313 }
314
315 // std::ostringstream output_identifier;
316 // output_identifier << "split_module_" << id << "_0";
317
318 // info["output_streams"] = nlohmann::json::array();
319 // info["output_streams"].push_back({
320 // {"alias", ""},
321 // {"identifier", output_identifier.str()},
322 // {"notify", ""}
323 // });
324
325 // info["option"] = option_.json_value_;
326 info["scheduler"] = scheduler;
327 info["dist_nums"] = 1;
328 info["input_manager"] = "immediate";
329
330 return NodeConfig(info);
331}
332
333NodeConfig create_assemble_node(int id, std::vector<StreamConfig> input_streams,
334 int scheduler, int dist_nums) {

Callers 1

process_distributed_nodeFunction · 0.85

Calls 5

strMethod · 0.80
NodeConfigClass · 0.50
get_aliasMethod · 0.45
get_identifierMethod · 0.45
get_notifyMethod · 0.45

Tested by

no test coverage detected