set a given edge in the graph - Used for deserialization of graph
| 182 | |
| 183 | // set a given edge in the graph - Used for deserialization of graph |
| 184 | void Serializer_Graph_SetEdge |
| 185 | ( |
| 186 | Graph *g, |
| 187 | bool multi_edge, |
| 188 | EdgeID edge_id, |
| 189 | NodeID src, |
| 190 | NodeID dest, |
| 191 | int r, |
| 192 | Edge *e |
| 193 | ) { |
| 194 | GrB_Info info; |
| 195 | |
| 196 | AttributeSet *set = DataBlock_AllocateItemOutOfOrder(g->edges, edge_id); |
| 197 | *set = NULL; |
| 198 | |
| 199 | e->id = edge_id; |
| 200 | e->src_id = src; |
| 201 | e->dest_id = dest; |
| 202 | e->attributes = set; |
| 203 | e->relationID = r; |
| 204 | |
| 205 | if(multi_edge) { |
| 206 | if(!Graph_FormConnection(g, src, dest, edge_id, r)) { |
| 207 | // resize matrices |
| 208 | RedisModule_Log(NULL, "notice", "RESIZE MATRIX MULTI EDGE"); |
| 209 | |
| 210 | uint64_t max_id = MAX(src, dest); |
| 211 | Graph_EnsureNodeCap(g, max_id); |
| 212 | bool res = Graph_FormConnection(g, src, dest, edge_id, r); |
| 213 | ASSERT(res == true); |
| 214 | } |
| 215 | } else { |
| 216 | _OptimizedSingleEdgeFormConnection(g, src, dest, edge_id, r); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | // returns the graph deleted nodes list |
| 221 | uint64_t *Serializer_Graph_GetDeletedNodesList |
no test coverage detected