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

Function ApplyUpdateEdge

src/effects/effects_apply.c:297–363  ·  view source on GitHub ↗

process Update_Edge effect

Source from the content-addressed store, hash-verified

295
296// process Update_Edge effect
297static void ApplyUpdateEdge
298(
299 FILE *stream, // effects stream
300 GraphContext *gc // graph to operate on
301) {
302 //--------------------------------------------------------------------------
303 // effect format:
304 // edge ID
305 // attribute ID
306 // attribute value
307 //--------------------------------------------------------------------------
308
309 SIValue v; // updated value
310 uint props_set; // number of attributes updated
311 uint props_removed; // number of attributes removed
312 Attribute_ID attr_id; // entity ID
313
314 NodeID s_id = INVALID_ENTITY_ID; // edge src node ID
315 NodeID t_id = INVALID_ENTITY_ID; // edge dest node ID
316 RelationID r_id = GRAPH_UNKNOWN_RELATION; // edge rel-type
317
318 EntityID id = INVALID_ENTITY_ID;
319
320 //--------------------------------------------------------------------------
321 // read edge ID
322 //--------------------------------------------------------------------------
323
324 fread_assert(&id, sizeof(EntityID), stream);
325 ASSERT(id != INVALID_ENTITY_ID);
326
327 //--------------------------------------------------------------------------
328 // read relation ID
329 //--------------------------------------------------------------------------
330
331 fread_assert(&r_id, sizeof(RelationID), stream);
332 ASSERT(r_id >= 0);
333
334 //--------------------------------------------------------------------------
335 // read src ID
336 //--------------------------------------------------------------------------
337
338 fread_assert(&s_id, sizeof(NodeID), stream);
339 ASSERT(s_id != INVALID_ENTITY_ID);
340
341 //--------------------------------------------------------------------------
342 // read dest ID
343 //--------------------------------------------------------------------------
344
345 fread_assert(&t_id, sizeof(NodeID), stream);
346 ASSERT(t_id != INVALID_ENTITY_ID);
347
348 //--------------------------------------------------------------------------
349 // read attribute ID
350 //--------------------------------------------------------------------------
351
352 fread_assert(&attr_id, sizeof(Attribute_ID), stream);
353
354 //--------------------------------------------------------------------------

Callers 1

Effects_ApplyFunction · 0.85

Calls 3

SIValue_FromBinaryFunction · 0.85
SIValue_IsNullFunction · 0.85
UpdateEdgePropertyFunction · 0.85

Tested by

no test coverage detected