@@ -19,9 +19,34 @@ class redis_request;
1919class ACL_CPP_API redis_command
2020{
2121public:
22+ /* *
23+ * 缺省的构造函数,如果使用此构造函数初始化类对象,则必须调用 set_client 或
24+ * set_cluster 设置 redis 客户端命令类对象的通讯方式。
25+ * default constructor. You must set the communication method by
26+ * set_client or set_cluster functions.
27+ */
2228 redis_command ();
29+
30+ /* *
31+ * 当使用非集群模式时的构造函数,可以使用此构造函数设置 redis 通信类对象。
32+ * Using this constructor to set the redis communication mode,
33+ * usually in no-cluster mode.
34+ * @param conn {redis_client*} redis 通信类对象
35+ * the redis communication in no-cluster mode
36+ */
2337 redis_command (redis_client* conn);
38+
39+ /* *
40+ * 使用集群模式的构造函数,在构造类对象时指定了集群模式的 redis_cluster 对象。
41+ * Using this constructor to set the redis_cluster, usually in
42+ * cluster mode.
43+ * @param cluster {redis_cluster*} redis 集群连接对象
44+ * redis cluster object in cluster mode
45+ * @param max_conns {size_t} 与集群中所有结点之间的每个连接池的最大连接数
46+ * the max of every connection pool with all the redis nodes
47+ */
2448 redis_command (redis_cluster* cluster, size_t max_conns);
49+
2550 virtual ~redis_command () = 0 ;
2651
2752 /* *
@@ -39,9 +64,9 @@ class ACL_CPP_API redis_command
3964 void reset (bool save_slot = false );
4065
4166 /* *
42- * 在使用连接池方式时 ,通过本函数将从连接池获得的连接对象;
43- * when using connection pool and not in cluster mode, the function
44- * is used to set the connection for next redis command operation.
67+ * 在使用非集群方式时 ,通过本函数将从连接池获得的连接对象;
68+ * when not using cluster mode, the function is used
69+ * to set the connection for next redis command operation.
4570 * @param conn {redis_client*} 与 redis 客户端命令进行关联;
4671 * the redis connection to be set in next redis operation
4772 */
@@ -232,6 +257,7 @@ class ACL_CPP_API redis_command
232257 const redis_result** scan_keys (const char * cmd, const char * key,
233258 int & cursor, size_t & size, const char * pattern,
234259 const size_t * count);
260+
235261 /* ******************************************************************/
236262
237263 void build (const char * cmd, const char * key,
0 commit comments