@@ -70,13 +70,16 @@ class RedisCache {
7070 Status Append (std::string& key, std::string &value);
7171 Status GetRange (std::string& key, int64_t start, int64_t end, std::string *value);
7272 Status SetRange (std::string& key, int64_t start, std::string &value);
73+ Status SetRangeIfKeyExist (std::string& key, int64_t start, std::string &value);
7374 Status Strlen (std::string& key, int32_t *len);
7475
7576 // Hash Commands
7677 Status HDel (std::string& key, std::vector<std::string> &fields);
7778 Status HSetIfKeyExist (std::string& key, std::string &field, std::string &value);
7879 Status HSetnx (std::string& key, std::string &field, std::string &value);
80+ Status HSetnxIfKeyExist (std::string& key, std::string &field, std::string &value);
7981 Status HMSet (std::string& key, std::vector<storage::FieldValue> &fvs);
82+ Status HMSetIfKeyExist (std::string& key, std::vector<storage::FieldValue> &fvs);
8083 Status HGet (std::string& key, std::string &field, std::string *value);
8184 Status HMGet (std::string& key,
8285 std::vector<std::string> &fields,
@@ -96,6 +99,7 @@ class RedisCache {
9699 std::string &pivot, std::string &value);
97100 Status LLen (std::string& key, uint64_t *len);
98101 Status LPop (std::string& key, std::string *element);
102+ Status LPushIfKeyExist (std::string& key, std::vector<std::string> &values);
99103 Status LPush (std::string& key, std::vector<std::string> &values);
100104 Status LPushx (std::string& key, std::vector<std::string> &values);
101105 Status LRange (std::string& key, int64_t start, int64_t stop, std::vector<std::string> *values);
@@ -104,10 +108,12 @@ class RedisCache {
104108 Status LTrim (std::string& key, int64_t start, int64_t stop);
105109 Status RPop (std::string& key, std::string *element);
106110 Status RPush (std::string& key, std::vector<std::string> &values);
111+ Status RPushIfKeyExist (std::string& key, std::vector<std::string> &values);
107112 Status RPushx (std::string& key, std::vector<std::string> &values);
108113
109114 // Set Commands
110115 Status SAdd (std::string& key, std::vector<std::string> &members);
116+ Status SAddIfKeyExist (std::string& key, std::vector<std::string> &members);
111117 Status SCard (std::string& key, uint64_t *len);
112118 Status SIsmember (std::string& key, std::string& member);
113119 Status SMembers (std::string& key, std::vector<std::string> *members);
@@ -116,6 +122,7 @@ class RedisCache {
116122
117123 // Zset Commands
118124 Status ZAdd (std::string& key, std::vector<storage::ScoreMember> &score_members);
125+ Status ZAddIfKeyExist (std::string& key, std::vector<storage::ScoreMember> &score_members);
119126 Status ZCard (std::string& key, uint64_t *len);
120127 Status ZCount (std::string& key, std::string &min, std::string &max, uint64_t *len);
121128 Status ZIncrby (std::string& key, std::string& member, double increment);
@@ -151,6 +158,7 @@ class RedisCache {
151158 Status ZPopMax (std::string& key, int64_t count, std::vector<storage::ScoreMember>* score_members);
152159
153160 // Bit Commands
161+ Status SetBitIfKeyExist (std::string& key, size_t offset, int64_t value);
154162 Status SetBit (std::string& key, size_t offset, int64_t value);
155163 Status GetBit (std::string& key, size_t offset, int64_t *value);
156164 Status BitCount (std::string& key, int64_t start, int64_t end, int64_t *value, bool have_offset);
0 commit comments