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

Function Graph_ApplyAllPending

src/graph/graph.c:313–358  ·  view source on GitHub ↗

synchronize and resize all matrices in graph

Source from the content-addressed store, hash-verified

311
312// synchronize and resize all matrices in graph
313void Graph_ApplyAllPending
314(
315 Graph *g,
316 bool force_flush
317) {
318 ASSERT(g != NULL);
319
320 uint n = 0;
321 RG_Matrix M = NULL;
322
323 // set matrix sync policy, backup previous sync policy
324 MATRIX_POLICY policy = Graph_SetMatrixPolicy(g, SYNC_POLICY_FLUSH_RESIZE);
325
326 //--------------------------------------------------------------------------
327 // sync every matrix
328 //--------------------------------------------------------------------------
329
330 // sync the adjacency matrix
331 M = Graph_GetAdjacencyMatrix(g, false);
332 RG_Matrix_wait(M, force_flush);
333
334 // sync node labels matrix
335 M = Graph_GetNodeLabelMatrix(g);
336 RG_Matrix_wait(M, force_flush);
337
338 // sync the zero matrix
339 M = Graph_GetZeroMatrix(g);
340 RG_Matrix_wait(M, force_flush);
341
342 // sync each label matrix
343 n = array_len(g->labels);
344 for(int i = 0; i < n; i ++) {
345 M = Graph_GetLabelMatrix(g, i);
346 RG_Matrix_wait(M, force_flush);
347 }
348
349 // sync each relation matrix
350 n = array_len(g->relations);
351 for(int i = 0; i < n; i ++) {
352 M = Graph_GetRelationMatrix(g, i, false);
353 RG_Matrix_wait(M, force_flush);
354 }
355
356 // restore previous matrix sync policy
357 Graph_SetMatrixPolicy(g, policy);
358}
359
360bool Graph_Pending
361(

Callers 14

RG_ForkPrepareFunction · 0.85
_InitGraphDataStructureFunction · 0.85
RdbLoadGraphContext_v13Function · 0.85
_InitGraphDataStructureFunction · 0.85
RdbLoadGraphContext_v11Function · 0.85
_InitGraphDataStructureFunction · 0.85
RdbLoadGraphContext_v9Function · 0.85
_InitGraphDataStructureFunction · 0.85
RdbLoadGraphContext_v10Function · 0.85
_InitGraphDataStructureFunction · 0.85
RdbLoadGraphContext_v8Function · 0.85
_InitGraphDataStructureFunction · 0.85

Calls 8

Graph_SetMatrixPolicyFunction · 0.85
Graph_GetAdjacencyMatrixFunction · 0.85
RG_Matrix_waitFunction · 0.85
Graph_GetNodeLabelMatrixFunction · 0.85
Graph_GetZeroMatrixFunction · 0.85
array_lenFunction · 0.85
Graph_GetLabelMatrixFunction · 0.85
Graph_GetRelationMatrixFunction · 0.85

Tested by 1

_build_graphFunction · 0.68