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
85 Geosearch(std::string key, std::string member,
double radius,
const GeosearchOptions& geosearch_options) = 0;
87 virtual RequestGeosearch Geosearch(
95 virtual RequestGeosearch Geosearch(
103 virtual RequestGeosearch Geosearch(
112 virtual RequestGet Get(std::string key) = 0;
114 virtual RequestGetset Getset(std::string key, std::string value) = 0;
116 virtual RequestHdel Hdel(std::string key, std::string field) = 0;
118 virtual RequestHdel Hdel(std::string key, std::vector<std::string> fields) = 0;
120 virtual RequestHexists Hexists(std::string key, std::string field) = 0;
122 virtual RequestHget Hget(std::string key, std::string field) = 0;
124 virtual RequestHgetall Hgetall(std::string key) = 0;
126 virtual RequestHincrby Hincrby(std::string key, std::string field, int64_t increment) = 0;
128 virtual RequestHincrbyfloat Hincrbyfloat(std::string key, std::string field,
double increment) = 0;
130 virtual RequestHkeys Hkeys(std::string key) = 0;
132 virtual RequestHlen Hlen(std::string key) = 0;
134 virtual RequestHmget Hmget(std::string key, std::vector<std::string> fields) = 0;
136 virtual RequestHmset Hmset(std::string key, std::vector<std::pair<std::string, std::string>> field_values) = 0;
138 virtual RequestHset Hset(std::string key, std::string field, std::string value) = 0;
140 virtual RequestHsetnx Hsetnx(std::string key, std::string field, std::string value) = 0;
142 virtual RequestHvals Hvals(std::string key) = 0;
144 virtual RequestIncr Incr(std::string key) = 0;
146 virtual RequestKeys Keys(std::string keys_pattern, size_t shard) = 0;
148 virtual RequestLindex Lindex(std::string key, int64_t index) = 0;
150 virtual RequestLlen Llen(std::string key) = 0;
152 virtual RequestLpop Lpop(std::string key) = 0;
154 virtual RequestLpush Lpush(std::string key, std::string value) = 0;
156 virtual RequestLpush Lpush(std::string key, std::vector<std::string> values) = 0;
158 virtual RequestLpushx Lpushx(std::string key, std::string element) = 0;
160 virtual RequestLrange Lrange(std::string key, int64_t start, int64_t stop) = 0;
162 virtual RequestLrem Lrem(std::string key, int64_t count, std::string element) = 0;
164 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop) = 0;
166 virtual RequestMget Mget(std::vector<std::string> keys) = 0;
168 virtual RequestMset Mset(std::vector<std::pair<std::string, std::string>> key_values) = 0;
170 virtual RequestPersist Persist(std::string key) = 0;
172 virtual RequestPexpire Pexpire(std::string key, std::chrono::milliseconds ttl) = 0;
174 virtual RequestPing Ping(size_t shard) = 0;
176 virtual RequestPingMessage PingMessage(size_t shard, std::string message) = 0;
178 virtual RequestRename Rename(std::string key, std::string new_key) = 0;
180 virtual RequestRpop Rpop(std::string key) = 0;
182 virtual RequestRpush Rpush(std::string key, std::string value) = 0;
184 virtual RequestRpush Rpush(std::string key, std::vector<std::string> values) = 0;
186 virtual RequestRpushx Rpushx(std::string key, std::string element) = 0;
188 virtual RequestSadd Sadd(std::string key, std::string member) = 0;
190 virtual RequestSadd Sadd(std::string key, std::vector<std::string> members) = 0;
192 virtual RequestScard Scard(std::string key) = 0;
194 virtual RequestSet Set(std::string key, std::string value) = 0;
196 virtual RequestSet Set(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
198 virtual RequestSetIfExist SetIfExist(std::string key, std::string value) = 0;
200 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
202 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value) = 0;
204 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
206 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(std::string key, std::string value) = 0;
208 virtual RequestSetIfNotExistOrGet
209 SetIfNotExistOrGet(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
211 virtual RequestSetex Setex(std::string key, std::chrono::seconds seconds, std::string value) = 0;
213 virtual RequestSismember Sismember(std::string key, std::string member) = 0;
215 virtual RequestSmembers Smembers(std::string key) = 0;
217 virtual RequestSrandmember Srandmember(std::string key) = 0;
219 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count) = 0;
221 virtual RequestSrem Srem(std::string key, std::string member) = 0;
223 virtual RequestSrem Srem(std::string key, std::vector<std::string> members) = 0;
225 virtual RequestStrlen Strlen(std::string key) = 0;
227 virtual RequestTime Time(size_t shard) = 0;
229 virtual RequestTtl Ttl(std::string key) = 0;
231 virtual RequestType Type(std::string key) = 0;
233 virtual RequestZadd Zadd(std::string key,
double score, std::string member) = 0;
235 virtual RequestZadd Zadd(std::string key,
double score, std::string member,
const ZaddOptions& options) = 0;
237 virtual RequestZadd Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members) = 0;
240 Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members,
const ZaddOptions& options) = 0;
242 virtual RequestZaddIncr ZaddIncr(std::string key,
double score, std::string member) = 0;
244 virtual RequestZaddIncrExisting ZaddIncrExisting(std::string key,
double score, std::string member) = 0;
246 virtual RequestZcard Zcard(std::string key) = 0;
248 virtual RequestZcount Zcount(std::string key,
double min,
double max) = 0;
250 virtual RequestZrange Zrange(std::string key, int64_t start, int64_t stop) = 0;
252 virtual RequestZrangeWithScores ZrangeWithScores(std::string key, int64_t start, int64_t stop) = 0;
254 virtual RequestZrangebyscore Zrangebyscore(std::string key,
double min,
double max) = 0;
256 virtual RequestZrangebyscore Zrangebyscore(std::string key, std::string min, std::string max) = 0;
258 virtual RequestZrangebyscore
259 Zrangebyscore(std::string key,
double min,
double max,
const RangeOptions& range_options) = 0;
261 virtual RequestZrangebyscore
262 Zrangebyscore(std::string key, std::string min, std::string max,
const RangeOptions& range_options) = 0;
264 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key,
double min,
double max) = 0;
266 virtual RequestZrangebyscoreWithScores
267 ZrangebyscoreWithScores(std::string key, std::string min, std::string max) = 0;
269 virtual RequestZrangebyscoreWithScores
270 ZrangebyscoreWithScores(std::string key,
double min,
double max,
const RangeOptions& range_options) = 0;
272 virtual RequestZrangebyscoreWithScores
273 ZrangebyscoreWithScores(std::string key, std::string min, std::string max,
const RangeOptions& range_options) = 0;
275 virtual RequestZrem Zrem(std::string key, std::string member) = 0;
277 virtual RequestZrem Zrem(std::string key, std::vector<std::string> members) = 0;
279 virtual RequestZremrangebyrank Zremrangebyrank(std::string key, int64_t start, int64_t stop) = 0;
281 virtual RequestZremrangebyscore Zremrangebyscore(std::string key,
double min,
double max) = 0;
283 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, std::string min, std::string max) = 0;
285 virtual RequestZscore Zscore(std::string key, std::string member) = 0;