33 enum class CheckShards { kNo, kSame };
35 virtual ~Transaction() =
default;
46 virtual RequestAppend Append(std::string key, std::string value) = 0;
48 virtual RequestBitop Bitop(BitOperation op, std::string dest, std::vector<std::string> srcs) = 0;
50 virtual RequestDbsize Dbsize(size_t shard) = 0;
52 virtual RequestDecr Decr(std::string key) = 0;
54 virtual RequestDel Del(std::string key) = 0;
56 virtual RequestDel Del(std::vector<std::string> keys) = 0;
58 virtual RequestUnlink Unlink(std::string key) = 0;
60 virtual RequestUnlink Unlink(std::vector<std::string> keys) = 0;
62 virtual RequestExists Exists(std::string key) = 0;
64 virtual RequestExists Exists(std::vector<std::string> keys) = 0;
66 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl) = 0;
68 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl,
ExpireOptions options) = 0;
70 virtual RequestGeoadd Geoadd(std::string key,
GeoaddArg point_member) = 0;
72 virtual RequestGeoadd Geoadd(std::string key, std::vector<
GeoaddArg> point_members) = 0;
74 virtual RequestGeopos Geopos(std::string key, std::vector<std::string> members) = 0;
76 virtual RequestGeoradius Georadius(
84 virtual RequestGeosearch Geosearch(
91 virtual RequestGeosearch Geosearch(
99 virtual RequestGeosearch Geosearch(
107 virtual RequestGeosearch Geosearch(
116 virtual RequestGet Get(std::string key) = 0;
118 virtual RequestGetset Getset(std::string key, std::string value) = 0;
120 virtual RequestHdel Hdel(std::string key, std::string field) = 0;
122 virtual RequestHdel Hdel(std::string key, std::vector<std::string> fields) = 0;
124 virtual RequestHexists Hexists(std::string key, std::string field) = 0;
126 virtual RequestHget Hget(std::string key, std::string field) = 0;
128 virtual RequestHgetall Hgetall(std::string key) = 0;
130 virtual RequestHincrby Hincrby(std::string key, std::string field, int64_t increment) = 0;
132 virtual RequestHincrbyfloat Hincrbyfloat(std::string key, std::string field,
double increment) = 0;
134 virtual RequestHkeys Hkeys(std::string key) = 0;
136 virtual RequestHlen Hlen(std::string key) = 0;
138 virtual RequestHmget Hmget(std::string key, std::vector<std::string> fields) = 0;
140 virtual RequestHmset Hmset(std::string key, std::vector<std::pair<std::string, std::string>> field_values) = 0;
142 virtual RequestHset Hset(std::string key, std::string field, std::string value) = 0;
144 virtual RequestHsetnx Hsetnx(std::string key, std::string field, std::string value) = 0;
146 virtual RequestHvals Hvals(std::string key) = 0;
148 virtual RequestIncr Incr(std::string key) = 0;
150 virtual RequestKeys Keys(std::string keys_pattern, size_t shard) = 0;
152 virtual RequestLindex Lindex(std::string key, int64_t index) = 0;
154 virtual RequestLlen Llen(std::string key) = 0;
156 virtual RequestLpop Lpop(std::string key) = 0;
158 virtual RequestLpush Lpush(std::string key, std::string value) = 0;
160 virtual RequestLpush Lpush(std::string key, std::vector<std::string> values) = 0;
162 virtual RequestLpushx Lpushx(std::string key, std::string element) = 0;
164 virtual RequestLrange Lrange(std::string key, int64_t start, int64_t stop) = 0;
166 virtual RequestLrem Lrem(std::string key, int64_t count, std::string element) = 0;
168 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop) = 0;
170 virtual RequestMget Mget(std::vector<std::string> keys) = 0;
172 virtual RequestMset Mset(std::vector<std::pair<std::string, std::string>> key_values) = 0;
174 virtual RequestPersist Persist(std::string key) = 0;
176 virtual RequestPexpire Pexpire(std::string key, std::chrono::milliseconds ttl) = 0;
178 virtual RequestPing Ping(size_t shard) = 0;
180 virtual RequestPingMessage PingMessage(size_t shard, std::string message) = 0;
182 virtual RequestRename Rename(std::string key, std::string new_key) = 0;
184 virtual RequestRpop Rpop(std::string key) = 0;
186 virtual RequestRpush Rpush(std::string key, std::string value) = 0;
188 virtual RequestRpush Rpush(std::string key, std::vector<std::string> values) = 0;
190 virtual RequestRpushx Rpushx(std::string key, std::string element) = 0;
192 virtual RequestSadd Sadd(std::string key, std::string member) = 0;
194 virtual RequestSadd Sadd(std::string key, std::vector<std::string> members) = 0;
196 virtual RequestScard Scard(std::string key) = 0;
198 virtual RequestSet Set(std::string key, std::string value) = 0;
200 virtual RequestSet Set(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
202 virtual RequestSetIfExist SetIfExist(std::string key, std::string value) = 0;
204 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
206 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value) = 0;
208 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
210 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(std::string key, std::string value) = 0;
212 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(
215 std::chrono::milliseconds ttl
218 virtual RequestSetex Setex(std::string key, std::chrono::seconds seconds, std::string value) = 0;
220 virtual RequestSismember Sismember(std::string key, std::string member) = 0;
222 virtual RequestSmembers Smembers(std::string key) = 0;
224 virtual RequestSrandmember Srandmember(std::string key) = 0;
226 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count) = 0;
228 virtual RequestSrem Srem(std::string key, std::string member) = 0;
230 virtual RequestSrem Srem(std::string key, std::vector<std::string> members) = 0;
232 virtual RequestStrlen Strlen(std::string key) = 0;
234 virtual RequestTime Time(size_t shard) = 0;
236 virtual RequestTtl Ttl(std::string key) = 0;
238 virtual RequestType Type(std::string key) = 0;
240 virtual RequestZadd Zadd(std::string key,
double score, std::string member) = 0;
242 virtual RequestZadd Zadd(std::string key,
double score, std::string member,
const ZaddOptions& options) = 0;
244 virtual RequestZadd Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members) = 0;
246 virtual RequestZadd Zadd(
248 std::vector<std::pair<
double, std::string>> scored_members,
252 virtual RequestZaddIncr ZaddIncr(std::string key,
double score, std::string member) = 0;
254 virtual RequestZaddIncrExisting ZaddIncrExisting(std::string key,
double score, std::string member) = 0;
256 virtual RequestZcard Zcard(std::string key) = 0;
258 virtual RequestZcount Zcount(std::string key,
double min,
double max) = 0;
260 virtual RequestZrange Zrange(std::string key, int64_t start, int64_t stop) = 0;
262 virtual RequestZrangeWithScores ZrangeWithScores(std::string key, int64_t start, int64_t stop) = 0;
264 virtual RequestZrangebyscore Zrangebyscore(std::string key,
double min,
double max) = 0;
266 virtual RequestZrangebyscore Zrangebyscore(std::string key, std::string min, std::string max) = 0;
268 virtual RequestZrangebyscore Zrangebyscore(
275 virtual RequestZrangebyscore Zrangebyscore(
282 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key,
double min,
double max) = 0;
284 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
290 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
297 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
304 virtual RequestZrem Zrem(std::string key, std::string member) = 0;
306 virtual RequestZrem Zrem(std::string key, std::vector<std::string> members) = 0;
308 virtual RequestZremrangebyrank Zremrangebyrank(std::string key, int64_t start, int64_t stop) = 0;
310 virtual RequestZremrangebyscore Zremrangebyscore(std::string key,
double min,
double max) = 0;
312 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, std::string min, std::string max) = 0;
314 virtual RequestZscore Zscore(std::string key, std::string member) = 0;