MCPcopy Create free account
hub / github.com/alibaba/GraphScope / splitAndGet

Function splitAndGet

analytical_engine/core/java/graphx_runner.h:111–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111std::pair<vineyard::ObjectID, int> splitAndGet(grape::CommSpec& comm_spec,
112 const std::string& ids) {
113 std::vector<std::string> split;
114 boost::split(split, ids, boost::is_any_of(","));
115 CHECK_EQ(split.size(), comm_spec.worker_num());
116 auto my_host_name = getHostName();
117 std::vector<std::string> pid_vineyard_id;
118 {
119 for (auto str : split) {
120 if (str.find(my_host_name) != std::string::npos) {
121 auto trimmed =
122 str.substr(str.find(my_host_name) + my_host_name.size() + 1);
123 pid_vineyard_id.push_back(trimmed);
124 }
125 }
126 }
127 CHECK_EQ(pid_vineyard_id.size(), comm_spec.local_num());
128 vineyard::ObjectID res_id;
129 int graphx_pid;
130
131 {
132 std::vector<std::string> graphx_pid_vm_id;
133 boost::split(graphx_pid_vm_id, pid_vineyard_id[comm_spec.local_id()],
134 boost::is_any_of(":"));
135 CHECK_EQ(graphx_pid_vm_id.size(), 2);
136 res_id = std::stoull(graphx_pid_vm_id[1]);
137 graphx_pid = std::stoi(graphx_pid_vm_id[0]);
138 }
139
140 LOG(INFO) << "worker [" << comm_spec.worker_id() << "], local id ["
141 << comm_spec.local_id() << "] got pid " << graphx_pid << ", id "
142 << res_id;
143 return std::make_pair(res_id, graphx_pid);
144}
145
146template <typename OID_T, typename VID_T, typename VD_T, typename ED_T>
147void LoadFragment(vineyard::Client& client, grape::CommSpec& comm_spec) {

Callers 2

LoadFragmentFunction · 0.85
RunGraphXFunction · 0.85

Calls 6

findMethod · 0.80
substrMethod · 0.80
worker_idMethod · 0.80
getHostNameFunction · 0.70
sizeMethod · 0.65
push_backMethod · 0.65

Tested by

no test coverage detected