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

Function ApplyCreateNode

src/effects/effects_apply.c:64–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64static void ApplyCreateNode
65(
66 FILE *stream, // effects stream
67 GraphContext *gc // graph to operate on
68) {
69 //--------------------------------------------------------------------------
70 // effect format:
71 // label count
72 // labels
73 // attribute count
74 // attributes (id,value) pair
75 //--------------------------------------------------------------------------
76
77 //--------------------------------------------------------------------------
78 // read label count
79 //--------------------------------------------------------------------------
80
81 ushort lbl_count;
82 fread_assert(&lbl_count, sizeof(lbl_count), stream);
83
84 //--------------------------------------------------------------------------
85 // read labels
86 //--------------------------------------------------------------------------
87
88 LabelID labels[lbl_count];
89 for(ushort i = 0; i < lbl_count; i++) {
90 fread_assert(labels + i, sizeof(LabelID), stream);
91 }
92
93 //--------------------------------------------------------------------------
94 // read attributes
95 //--------------------------------------------------------------------------
96
97 AttributeSet attr_set = ReadAttributeSet(stream);
98
99 //--------------------------------------------------------------------------
100 // create node
101 //--------------------------------------------------------------------------
102
103 Node n = GE_NEW_NODE();
104 CreateNode(gc, &n, labels, lbl_count, attr_set, false);
105}
106
107static void ApplyCreateEdge
108(

Callers 1

Effects_ApplyFunction · 0.85

Calls 2

ReadAttributeSetFunction · 0.85
CreateNodeFunction · 0.85

Tested by

no test coverage detected