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

Function GraphEncodeContext_Reset

src/serializers/encode_context.c:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void GraphEncodeContext_Reset(GraphEncodeContext *ctx) {
39 ASSERT(ctx != NULL);
40
41 _GraphEncodeContext_ResetHeader(ctx);
42
43 ctx->offset = 0;
44 ctx->keys_processed = 0;
45 ctx->state = ENCODE_STATE_INIT;
46 ctx->multiple_edges_src_id = 0;
47 ctx->multiple_edges_dest_id = 0;
48 ctx->multiple_edges_array = NULL;
49 ctx->current_relation_matrix_id = 0;
50 ctx->multiple_edges_current_index = 0;
51
52 Config_Option_get(Config_VKEY_MAX_ENTITY_COUNT, &ctx->vkey_entity_count);
53
54 // Avoid leaks in case or reset during encodeing.
55 if(ctx->datablock_iterator != NULL) {
56 DataBlockIterator_Free(ctx->datablock_iterator);
57 ctx->datablock_iterator = NULL;
58 }
59
60 // Avoid leaks in case or reset during encodeing.
61 RG_MatrixTupleIter_detach(&ctx->matrix_tuple_iterator);
62}
63
64void GraphEncodeContext_InitHeader
65(

Callers 2

GraphEncodeContext_NewFunction · 0.85
RdbSaveGraph_v13Function · 0.85

Calls 4

Config_Option_getFunction · 0.85
DataBlockIterator_FreeFunction · 0.85

Tested by

no test coverage detected