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

Function Graph_SetMatrixPolicy

src/graph/graph.c:283–310  ·  view source on GitHub ↗

define the current behavior for matrix creations and retrievals on this graph

Source from the content-addressed store, hash-verified

281
282// define the current behavior for matrix creations and retrievals on this graph
283MATRIX_POLICY Graph_SetMatrixPolicy
284(
285 Graph *g,
286 MATRIX_POLICY policy
287) {
288 MATRIX_POLICY prev_policy = Graph_GetMatrixPolicy(g);
289
290 switch(policy) {
291 case SYNC_POLICY_FLUSH_RESIZE:
292 // Default behavior; forces execution of pending GraphBLAS operations
293 // when appropriate and sizes matrices to the current node count.
294 g->SynchronizeMatrix = _MatrixSynchronize;
295 break;
296 case SYNC_POLICY_RESIZE:
297 // Bulk insertion and creation behavior; does not force pending operations
298 // and resizes matrices to the graph's current node capacity.
299 g->SynchronizeMatrix = _MatrixResizeToCapacity;
300 break;
301 case SYNC_POLICY_NOP:
302 // Used when deleting or freeing a graph; forces no matrix updates or resizes.
303 g->SynchronizeMatrix = _MatrixNOP;
304 break;
305 default:
306 ASSERT(false);
307 }
308
309 return prev_policy;
310}
311
312// synchronize and resize all matrices in graph
313void Graph_ApplyAllPending

Callers 15

RG_ForkPrepareFunction · 0.85
RG_AfterForkChildFunction · 0.85
_ExecuteQueryFunction · 0.85
_GetOrCreateGraphContextFunction · 0.85
RdbLoadGraphContext_v13Function · 0.85
_GetOrCreateGraphContextFunction · 0.85
RdbLoadGraphContext_v11Function · 0.85
_GetOrCreateGraphContextFunction · 0.85
RdbLoadGraphContext_v9Function · 0.85
_GetOrCreateGraphContextFunction · 0.85
RdbLoadGraphContext_v10Function · 0.85
_GetOrCreateGraphContextFunction · 0.85

Calls 1

Graph_GetMatrixPolicyFunction · 0.85

Tested by

no test coverage detected