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

Function _ExecutionPlan_Print

src/execution_plan/execution_plan_debug.c:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "./ops/ops.h"
10
11void _ExecutionPlan_Print(const OpBase *op, RedisModuleCtx *ctx, sds *buffer,
12 int ident, int *op_count) {
13 if(!op) return;
14
15 *op_count += 1; // account for current operation.
16
17 // Construct operation string representation.
18 sdsclear(*buffer);
19 *buffer = sdscatprintf(*buffer, "%*s", ident, "");
20 OpBase_ToString(op, buffer);
21
22 RedisModule_ReplyWithStringBuffer(ctx, *buffer, sdslen(*buffer));
23
24 // Recurse over child operations.
25 for(int i = 0; i < op->childCount; i++) {
26 _ExecutionPlan_Print(op->children[i], ctx, buffer, ident + 4, op_count);
27 }
28}
29
30// Reply with a string representation of given execution plan.
31void ExecutionPlan_Print(const ExecutionPlan *plan, RedisModuleCtx *ctx) {

Callers 1

ExecutionPlan_PrintFunction · 0.85

Calls 4

sdsclearFunction · 0.85
sdscatprintfFunction · 0.85
OpBase_ToStringFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected