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

Function ApplyUpdateNode

src/effects/effects_apply.c:366–406  ·  view source on GitHub ↗

process UpdateNode effect

Source from the content-addressed store, hash-verified

364
365// process UpdateNode effect
366static void ApplyUpdateNode
367(
368 FILE *stream, // effects stream
369 GraphContext *gc // graph to operate on
370) {
371 //--------------------------------------------------------------------------
372 // effect format:
373 // entity ID
374 // attribute ID
375 // attribute value
376 //--------------------------------------------------------------------------
377
378 SIValue v; // updated value
379 uint props_set; // number of attributes updated
380 uint props_removed; // number of attributes removed
381 Attribute_ID attr_id; // entity ID
382
383 EntityID id = INVALID_ENTITY_ID;
384
385 //--------------------------------------------------------------------------
386 // read node ID
387 //--------------------------------------------------------------------------
388
389 fread_assert(&id, sizeof(EntityID), stream);
390
391 //--------------------------------------------------------------------------
392 // read attribute ID
393 //--------------------------------------------------------------------------
394
395 fread_assert(&attr_id, sizeof(Attribute_ID), stream);
396
397 //--------------------------------------------------------------------------
398 // read attribute ID
399 //--------------------------------------------------------------------------
400
401 v = SIValue_FromBinary(stream);
402 ASSERT(SI_TYPE(v) & (SI_VALID_PROPERTY_VALUE | T_NULL));
403 ASSERT((attr_id != ATTRIBUTE_ID_ALL || SIValue_IsNull(v)) && attr_id != ATTRIBUTE_ID_NONE);
404
405 UpdateNodeProperty(gc, id, attr_id, v);
406}
407
408// process DeleteNode effect
409static void ApplyDeleteNode

Callers 1

Effects_ApplyFunction · 0.85

Calls 3

SIValue_FromBinaryFunction · 0.85
SIValue_IsNullFunction · 0.85
UpdateNodePropertyFunction · 0.85

Tested by

no test coverage detected