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 RequestGeoadd Geoadd(std::string key,
GeoaddArg point_member) = 0;
70 virtual RequestGeoadd Geoadd(std::string key, std::vector<
GeoaddArg> point_members) = 0;
72 virtual RequestGeoradius Georadius(
80 virtual RequestGeosearch
81 Geosearch(std::string key, std::string member,
double radius,
const GeosearchOptions& geosearch_options) = 0;
83 virtual RequestGeosearch Geosearch(
91 virtual RequestGeosearch Geosearch(
99 virtual RequestGeosearch Geosearch(
108 virtual RequestGet Get(std::string key) = 0;
110 virtual RequestGetset Getset(std::string key, std::string value) = 0;
112 virtual RequestHdel Hdel(std::string key, std::string field) = 0;
114 virtual RequestHdel Hdel(std::string key, std::vector<std::string> fields) = 0;
116 virtual RequestHexists Hexists(std::string key, std::string field) = 0;
118 virtual RequestHget Hget(std::string key, std::string field) = 0;
120 virtual RequestHgetall Hgetall(std::string key) = 0;
122 virtual RequestHincrby Hincrby(std::string key, std::string field, int64_t increment) = 0;
124 virtual RequestHincrbyfloat Hincrbyfloat(std::string key, std::string field,
double increment) = 0;
126 virtual RequestHkeys Hkeys(std::string key) = 0;
128 virtual RequestHlen Hlen(std::string key) = 0;
130 virtual RequestHmget Hmget(std::string key, std::vector<std::string> fields) = 0;
132 virtual RequestHmset Hmset(std::string key, std::vector<std::pair<std::string, std::string>> field_values) = 0;
134 virtual RequestHset Hset(std::string key, std::string field, std::string value) = 0;
136 virtual RequestHsetnx Hsetnx(std::string key, std::string field, std::string value) = 0;
138 virtual RequestHvals Hvals(std::string key) = 0;
140 virtual RequestIncr Incr(std::string key) = 0;
142 virtual RequestKeys Keys(std::string keys_pattern, size_t shard) = 0;
144 virtual RequestLindex Lindex(std::string key, int64_t index) = 0;
146 virtual RequestLlen Llen(std::string key) = 0;
148 virtual RequestLpop Lpop(std::string key) = 0;
150 virtual RequestLpush Lpush(std::string key, std::string value) = 0;
152 virtual RequestLpush Lpush(std::string key, std::vector<std::string> values) = 0;
154 virtual RequestLpushx Lpushx(std::string key, std::string element) = 0;
156 virtual RequestLrange Lrange(std::string key, int64_t start, int64_t stop) = 0;
158 virtual RequestLrem Lrem(std::string key, int64_t count, std::string element) = 0;
160 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop) = 0;
162 virtual RequestMget Mget(std::vector<std::string> keys) = 0;
164 virtual RequestMset Mset(std::vector<std::pair<std::string, std::string>> key_values) = 0;
166 virtual RequestPersist Persist(std::string key) = 0;
168 virtual RequestPexpire Pexpire(std::string key, std::chrono::milliseconds ttl) = 0;
170 virtual RequestPing Ping(size_t shard) = 0;
172 virtual RequestPingMessage PingMessage(size_t shard, std::string message) = 0;
174 virtual RequestRename Rename(std::string key, std::string new_key) = 0;
176 virtual RequestRpop Rpop(std::string key) = 0;
178 virtual RequestRpush Rpush(std::string key, std::string value) = 0;
180 virtual RequestRpush Rpush(std::string key, std::vector<std::string> values) = 0;
182 virtual RequestRpushx Rpushx(std::string key, std::string element) = 0;
184 virtual RequestSadd Sadd(std::string key, std::string member) = 0;
186 virtual RequestSadd Sadd(std::string key, std::vector<std::string> members) = 0;
188 virtual RequestScard Scard(std::string key) = 0;
190 virtual RequestSet Set(std::string key, std::string value) = 0;
192 virtual RequestSet Set(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
194 virtual RequestSetIfExist SetIfExist(std::string key, std::string value) = 0;
196 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
198 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value) = 0;
200 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value, std::chrono::milliseconds ttl) = 0;
202 virtual RequestSetex Setex(std::string key, std::chrono::seconds seconds, std::string value) = 0;
204 virtual RequestSismember Sismember(std::string key, std::string member) = 0;
206 virtual RequestSmembers Smembers(std::string key) = 0;
208 virtual RequestSrandmember Srandmember(std::string key) = 0;
210 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count) = 0;
212 virtual RequestSrem Srem(std::string key, std::string member) = 0;
214 virtual RequestSrem Srem(std::string key, std::vector<std::string> members) = 0;
216 virtual RequestStrlen Strlen(std::string key) = 0;
218 virtual RequestTime Time(size_t shard) = 0;
220 virtual RequestTtl Ttl(std::string key) = 0;
222 virtual RequestType Type(std::string key) = 0;
224 virtual RequestZadd Zadd(std::string key,
double score, std::string member) = 0;
226 virtual RequestZadd Zadd(std::string key,
double score, std::string member,
const ZaddOptions& options) = 0;
228 virtual RequestZadd Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members) = 0;
231 Zadd(std::string key, std::vector<std::pair<
double, std::string>> scored_members,
const ZaddOptions& options) = 0;
233 virtual RequestZaddIncr ZaddIncr(std::string key,
double score, std::string member) = 0;
235 virtual RequestZaddIncrExisting ZaddIncrExisting(std::string key,
double score, std::string member) = 0;
237 virtual RequestZcard Zcard(std::string key) = 0;
239 virtual RequestZcount Zcount(std::string key,
double min,
double max) = 0;
241 virtual RequestZrange Zrange(std::string key, int64_t start, int64_t stop) = 0;
243 virtual RequestZrangeWithScores ZrangeWithScores(std::string key, int64_t start, int64_t stop) = 0;
245 virtual RequestZrangebyscore Zrangebyscore(std::string key,
double min,
double max) = 0;
247 virtual RequestZrangebyscore Zrangebyscore(std::string key, std::string min, std::string max) = 0;
249 virtual RequestZrangebyscore
250 Zrangebyscore(std::string key,
double min,
double max,
const RangeOptions& range_options) = 0;
252 virtual RequestZrangebyscore
253 Zrangebyscore(std::string key, std::string min, std::string max,
const RangeOptions& range_options) = 0;
255 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key,
double min,
double max) = 0;
257 virtual RequestZrangebyscoreWithScores
258 ZrangebyscoreWithScores(std::string key, std::string min, std::string max) = 0;
260 virtual RequestZrangebyscoreWithScores
261 ZrangebyscoreWithScores(std::string key,
double min,
double max,
const RangeOptions& range_options) = 0;
263 virtual RequestZrangebyscoreWithScores
264 ZrangebyscoreWithScores(std::string key, std::string min, std::string max,
const RangeOptions& range_options) = 0;
266 virtual RequestZrem Zrem(std::string key, std::string member) = 0;
268 virtual RequestZrem Zrem(std::string key, std::vector<std::string> members) = 0;
270 virtual RequestZremrangebyrank Zremrangebyrank(std::string key, int64_t start, int64_t stop) = 0;
272 virtual RequestZremrangebyscore Zremrangebyscore(std::string key,
double min,
double max) = 0;
274 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, std::string min, std::string max) = 0;
276 virtual RequestZscore Zscore(std::string key, std::string member) = 0;