33 enum class CheckShards { kNo, kSame };
35 virtual ~Transaction() =
default;
52 constexpr auto kSingleConditionCount = 1;
58 virtual RequestAppend Append(std::string key, std::string value) = 0;
60 virtual RequestBitop Bitop(
BitOperation op, std::string dest, std::vector<std::string> srcs) = 0;
62 virtual RequestDbsize Dbsize(size_t shard) = 0;
64 virtual RequestDecr Decr(std::string key) = 0;
66 virtual RequestDel Del(std::string key) = 0;
68 virtual RequestDel Del(std::vector<std::string> keys) = 0;
70 virtual RequestUnlink Unlink(std::string key) = 0;
72 virtual RequestUnlink Unlink(std::vector<std::string> keys) = 0;
74 virtual RequestExists Exists(std::string key) = 0;
76 virtual RequestExists Exists(std::vector<std::string> keys) = 0;
78 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl) = 0;
80 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl,
ExpireOptions options) = 0;
82 virtual RequestGeoadd Geoadd(std::string key,
GeoaddArg point_member) = 0;
84 virtual RequestGeoadd Geoadd(std::string key, std::vector<
GeoaddArg> point_members) = 0;
86 virtual RequestGeopos Geopos(std::string key, std::vector<std::string> members) = 0;
88 virtual RequestGeoradius Georadius(
96 virtual RequestGeosearch Geosearch(
103 virtual RequestGeosearch Geosearch(
111 virtual RequestGeosearch Geosearch(
119 virtual RequestGeosearch Geosearch(
128 virtual RequestGet Get(std::string key) = 0;
130 virtual RequestGetdel Getdel(std::string key) = 0;
132 virtual RequestGetset Getset(std::string key, std::string value) = 0;
134 virtual RequestHdel Hdel(std::string key, std::string field) = 0;
136 virtual RequestHdel Hdel(std::string key, std::vector<std::string> fields) = 0;
138 virtual RequestHexists Hexists(std::string key, std::string field) = 0;
140 virtual RequestHget Hget(std::string key, std::string field) = 0;
142 virtual RequestHgetall Hgetall(std::string key) = 0;
144 virtual RequestHincrby Hincrby(std::string key, std::string field, int64_t increment) = 0;
146 virtual RequestHincrbyfloat Hincrbyfloat(std::string key, std::string field,
double increment) = 0;
148 virtual RequestHkeys Hkeys(std::string key) = 0;
150 virtual RequestHlen Hlen(std::string key) = 0;
152 virtual RequestHmget Hmget(std::string key, std::vector<std::string> fields) = 0;
154 virtual RequestHmset Hmset(std::string key, std::vector<std::pair<std::string, std::string>> field_values) = 0;
156 virtual RequestHset Hset(std::string key, std::string field, std::string value) = 0;
158 virtual RequestHsetnx Hsetnx(std::string key, std::string field, std::string value) = 0;
160 virtual RequestHvals Hvals(std::string key) = 0;
162 virtual RequestIncr Incr(std::string key) = 0;
164 virtual RequestKeys Keys(std::string keys_pattern, size_t shard) = 0;
166 virtual RequestLindex Lindex(std::string key, int64_t index) = 0;
168 virtual RequestLlen Llen(std::string key) = 0;
170 virtual RequestLpop Lpop(std::string key) = 0;
172 virtual RequestLpush Lpush(std::string key, std::string value) = 0;
174 virtual RequestLpush Lpush(std::string key, std::vector<std::string> values) = 0;
176 virtual RequestLpushx Lpushx(std::string key, std::string element) = 0;
178 virtual RequestLrange Lrange(std::string key, int64_t start, int64_t stop) = 0;
180 virtual RequestLrem Lrem(std::string key, int64_t count, std::string element) = 0;
182 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop) = 0;
184 virtual RequestMget Mget(std::vector<std::string> keys) = 0;
186 virtual RequestMset Mset(std::vector<std::pair<std::string, std::string>> key_values) = 0;
189 virtual RequestMsetex
Msetex(std::vector<std::pair<std::string, std::string>> key_values) = 0;
193 std::vector<std::pair<std::string, std::string>> key_values,
197 virtual RequestPersist Persist(std::string key) = 0;
199 virtual RequestPexpire Pexpire(std::string key, std::chrono::milliseconds ttl) = 0;
201 virtual RequestPing Ping(size_t shard) = 0;
203 virtual RequestPingMessage PingMessage(size_t shard, std::string message) = 0;
205 virtual RequestRename Rename(std::string key, std::string new_key) = 0;
207 virtual RequestRpop Rpop(std::string key) = 0;
209 virtual RequestRpush Rpush(std::string key, std::string value) = 0;
211 virtual RequestRpush Rpush(std::string key, std::vector<std::string> values) = 0;
213 virtual RequestRpushx Rpushx(std::string key, std::string element) = 0;
215 virtual RequestSadd Sadd(std::string key, std::string member) = 0;
217 virtual RequestSadd Sadd(std::string key, std::vector<std::string> members) = 0;
219 virtual RequestScard Scard(std::string key) = 0;
221 virtual RequestSet Set(std::string key, std::string value) = 0;
223 virtual RequestSet Set(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
225 virtual RequestSetIfExist SetIfExist(std::string key, std::string value) = 0;
227 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
229 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value) = 0;
231 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
233 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(std::string key, std::string value) = 0;
235 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(
238 std::chrono::milliseconds ttl
241 virtual RequestSetex Setex(std::string key, std::chrono::seconds seconds, std::string value) = 0;
243 virtual RequestSetAndGetPrevious SetAndGetPrevious(
246 std::chrono::milliseconds ttl
249 virtual RequestSismember Sismember(std::string key, std::string member) = 0;
251 virtual RequestSmembers Smembers(std::string key) = 0;
253 virtual RequestSrandmember Srandmember(std::string key) = 0;
255 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count) = 0;
257 virtual RequestSrem Srem(std::string key, std::string member) = 0;
259 virtual RequestSrem Srem(std::string key, std::vector<std::string> members) = 0;
261 virtual RequestStrlen Strlen(std::string key) = 0;
263 virtual RequestTime Time(size_t shard) = 0;
265 virtual RequestTtl Ttl(std::string key) = 0;
267 virtual RequestType Type(std::string key) = 0;
269 virtual RequestZadd Zadd(std::string key,
double score, std::string member) = 0;
271 virtual RequestZadd Zadd(std::string key,
double score, std::string member,
const ZaddOptions& options) = 0;
273 virtual RequestZadd Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members) = 0;
275 virtual RequestZadd Zadd(
277 std::vector<std::pair<
double, std::string>> scored_members,
281 virtual RequestZaddIncr ZaddIncr(std::string key,
double score, std::string member) = 0;
283 virtual RequestZaddIncrExisting ZaddIncrExisting(std::string key,
double score, std::string member) = 0;
285 virtual RequestZcard Zcard(std::string key) = 0;
287 virtual RequestZcount Zcount(std::string key,
double min,
double max) = 0;
289 virtual RequestZrange Zrange(std::string key, int64_t start, int64_t stop) = 0;
291 virtual RequestZrangeWithScores ZrangeWithScores(std::string key, int64_t start, int64_t stop) = 0;
293 virtual RequestZrangebyscore Zrangebyscore(std::string key,
double min,
double max) = 0;
295 virtual RequestZrangebyscore Zrangebyscore(std::string key, std::string min, std::string max) = 0;
297 virtual RequestZrangebyscore Zrangebyscore(
304 virtual RequestZrangebyscore Zrangebyscore(
311 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key,
double min,
double max) = 0;
313 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
319 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
326 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
333 virtual RequestZrem Zrem(std::string key, std::string member) = 0;
335 virtual RequestZrem Zrem(std::string key, std::vector<std::string> members) = 0;
337 virtual RequestZremrangebyrank Zremrangebyrank(std::string key, int64_t start, int64_t stop) = 0;
339 virtual RequestZremrangebyscore Zremrangebyscore(std::string key,
double min,
double max) = 0;
341 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, std::string min, std::string max) = 0;
343 virtual RequestZscore Zscore(std::string key, std::string member) = 0;
347 virtual RequestHexpire Hexpire(std::string key, std::chrono::seconds ttl, std::vector<std::string> fields) = 0;
349 virtual RequestHexpire Hexpire(
351 std::chrono::seconds ttl,
353 std::vector<std::string> fields
356 virtual RequestHexpire Hpexpire(
358 std::chrono::milliseconds ttl,
359 std::vector<std::string> fields
362 virtual RequestHexpire Hpexpire(
364 std::chrono::milliseconds ttl,
366 std::vector<std::string> fields
369 virtual RequestHexpire Hexpireat(
371 std::chrono::system_clock::time_point deadline,
372 std::vector<std::string> fields
375 virtual RequestHexpire Hexpireat(
377 std::chrono::system_clock::time_point deadline,
379 std::vector<std::string> fields
382 virtual RequestHexpire Hpexpireat(
384 std::chrono::system_clock::time_point deadline,
385 std::vector<std::string> fields
388 virtual RequestHexpire Hpexpireat(
390 std::chrono::system_clock::time_point deadline,
392 std::vector<std::string> fields
395 virtual RequestHexpiretime Hexpiretime(std::string key, std::vector<std::string> fields) = 0;
397 virtual RequestHpexpiretime Hpexpiretime(std::string key, std::vector<std::string> fields) = 0;
399 virtual RequestHttl Httl(std::string key, std::vector<std::string> fields) = 0;
401 virtual RequestHpttl Hpttl(std::string key, std::vector<std::string> fields) = 0;
403 virtual RequestHpersist Hpersist(std::string key, std::vector<std::string> fields) = 0;
405 virtual RequestHgetex Hgetex(std::string key, std::vector<std::string> fields) = 0;
407 virtual RequestHgetex Hgetex(std::string key,
HgetexOptions options, std::vector<std::string> fields) = 0;
409 virtual RequestHsetex Hsetex(std::string key, std::vector<
HsetexFieldValue> field_values) = 0;
411 virtual RequestHsetex Hsetex(
419 virtual RequestJsonSet JsonSet(std::string key, std::string path, formats::
json::
Value value) = 0;
421 virtual RequestJsonSetIfNotExist JsonSetIfNotExist(
427 virtual RequestJsonSetIfExist JsonSetIfExist(std::string key, std::string path, formats::
json::
Value value) = 0;
429 virtual RequestJsonGet JsonGet(std::string key) = 0;
431 virtual RequestJsonGet JsonGet(std::string key, std::string path) = 0;
433 virtual RequestJsonGet JsonGet(std::string key, std::vector<std::string> paths) = 0;
435 virtual RequestJsonMget JsonMget(std::vector<std::string> keys, std::string path) = 0;
437 virtual RequestJsonMset JsonMset(std::vector<JsonKeyPathValue> key_path_values) = 0;