MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Serializer_Graph_SetEdge

Function Serializer_Graph_SetEdge

src/serializers/graph_extensions.c:184–218  ·  view source on GitHub ↗

set a given edge in the graph - Used for deserialization of graph

Source from the content-addressed store, hash-verified

182
183// set a given edge in the graph - Used for deserialization of graph
184void 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
221uint64_t *Serializer_Graph_GetDeletedNodesList

Callers 6

RdbLoadEdges_v13Function · 0.85
RdbLoadEdges_v11Function · 0.85
RdbLoadEdges_v9Function · 0.85
RdbLoadEdges_v10Function · 0.85
RdbLoadEdges_v8Function · 0.85
RdbLoadEdges_v12Function · 0.85

Calls 4

Graph_FormConnectionFunction · 0.85
Graph_EnsureNodeCapFunction · 0.85

Tested by

no test coverage detected