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

Function GraphContext_Rename

src/graph/graphcontext.c:268–284  ·  view source on GitHub ↗

rename a graph context

Source from the content-addressed store, hash-verified

266
267// rename a graph context
268void GraphContext_Rename
269(
270 RedisModuleCtx *ctx, // redis module context
271 GraphContext *gc, // graph context to rename
272 const char *name // new name
273) {
274 rm_free(gc->graph_name);
275 gc->graph_name = rm_strdup(name);
276
277 // drop old telemetry stream
278 _DeleteTelemetryStream(ctx, gc);
279
280 // recreate telemetry stream name
281 RedisModule_FreeString(ctx, gc->telemetry_stream);
282 gc->telemetry_stream = RedisModule_CreateStringPrintf(NULL,
283 TELEMETRY_FORMAT, gc->graph_name);
284}
285
286XXH32_hash_t GraphContext_GetVersion(const GraphContext *gc) {
287 ASSERT(gc != NULL);

Callers 1

_GenericKeyspaceHandlerFunction · 0.85

Calls 3

rm_freeFunction · 0.85
rm_strdupFunction · 0.85
_DeleteTelemetryStreamFunction · 0.85

Tested by

no test coverage detected