77
88/**
99 * DAGRUN Building Block to parse [LOAD <nkeys> key1 key2... ]
10+ *
11+ * @param ctx Context in which Redis modules operate
12+ * @param argv Redis command arguments, as an array of strings
13+ * @param argc Redis command number of arguments
14+ * @param loadedContextDict local non-blocking hash table containing key names
15+ * loaded from the keyspace tensors
16+ * @param localContextDict local non-blocking hash table containing DAG's
17+ * tensors
18+ * @param chaining_operator operator used to split operations. Any command
19+ * argument after the chaining operator is not considered
20+ * @return processed number of arguments on success, or -1 if the parsing failed
1021 */
11- int RAI_parseDAGLoadArgs (RedisModuleCtx * ctx , RedisModuleString * * argv , int argc ,
12- AI_dict * * loadedContextDict , AI_dict * * localContextDict ,
13- const char * chaining_operator ) {
22+ static int DAG_ParseLoadArgs (RedisModuleCtx * ctx , RedisModuleString * * argv , int argc ,
23+ AI_dict * * loadedContextDict , AI_dict * * localContextDict ,
24+ const char * chaining_operator ) {
1425 if (argc < 3 ) {
1526 RedisModule_WrongArity (ctx );
1627 return -1 ;
@@ -60,9 +71,18 @@ int RAI_parseDAGLoadArgs(RedisModuleCtx *ctx, RedisModuleString **argv, int argc
6071
6172/**
6273 * DAGRUN Building Block to parse [PERSIST <nkeys> key1 key2... ]
74+ *
75+ * @param ctx Context in which Redis modules operate
76+ * @param argv Redis command arguments, as an array of strings
77+ * @param argc Redis command number of arguments
78+ * @param localContextDict local non-blocking hash table containing DAG's
79+ * keynames marked as persistent
80+ * @param chaining_operator operator used to split operations. Any command
81+ * argument after the chaining operator is not considered
82+ * @return processed number of arguments on success, or -1 if the parsing failed
6383 */
64- int RAI_parseDAGPersistArgs (RedisModuleCtx * ctx , RedisModuleString * * argv , int argc ,
65- AI_dict * * persistContextDict , const char * chaining_operator ) {
84+ static int DAG_ParsePersistArgs (RedisModuleCtx * ctx , RedisModuleString * * argv , int argc ,
85+ AI_dict * * persistContextDict , const char * chaining_operator ) {
6686 if (argc < 3 ) {
6787 RedisModule_WrongArity (ctx );
6888 return -1 ;
@@ -129,9 +149,9 @@ int DAG_CommandParser(RedisModuleCtx *ctx, RedisModuleString **argv, int argc, i
129149 if (!strcasecmp (arg_string , "LOAD" ) && !load_complete ) {
130150 /* Load the required tensors from key space and store them in both
131151 dagTensorsLoadedContext and dagTensorsContext dicts. */
132- const int parse_result = RAI_parseDAGLoadArgs (ctx , & argv [arg_pos ], argc - arg_pos ,
133- & (rinfo -> dagTensorsLoadedContext ),
134- & (rinfo -> dagTensorsContext ), "|>" );
152+ const int parse_result = DAG_ParseLoadArgs (ctx , & argv [arg_pos ], argc - arg_pos ,
153+ & (rinfo -> dagTensorsLoadedContext ),
154+ & (rinfo -> dagTensorsContext ), "|>" );
135155 if (parse_result > 0 ) {
136156 arg_pos += parse_result - 1 ;
137157 load_complete = true;
@@ -148,7 +168,7 @@ int DAG_CommandParser(RedisModuleCtx *ctx, RedisModuleString **argv, int argc, i
148168 }
149169 /* Store the keys to persist in dagTensorsPersistedContext dict.
150170 These keys will be populated late on with actual tensors. */
151- const int parse_result = RAI_parseDAGPersistArgs (
171+ const int parse_result = DAG_ParsePersistArgs (
152172 ctx , & argv [arg_pos ], argc - arg_pos , & (rinfo -> dagTensorsPersistedContext ), "|>" );
153173 if (parse_result > 0 ) {
154174 arg_pos += parse_result - 1 ;
0 commit comments