forked from redis/jedis
/
BinaryJedisCommands.java
363 lines (201 loc) · 10.3 KB
/
BinaryJedisCommands.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
package redis.clients.jedis.commands;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.GeoCoordinate;
import redis.clients.jedis.GeoRadiusResponse;
import redis.clients.jedis.GeoUnit;
import redis.clients.jedis.ListPosition;
import redis.clients.jedis.ScanParams;
import redis.clients.jedis.ScanResult;
import redis.clients.jedis.SortingParams;
import redis.clients.jedis.Tuple;
import redis.clients.jedis.params.GeoRadiusParam;
import redis.clients.jedis.params.SetParams;
import redis.clients.jedis.params.ZAddParams;
import redis.clients.jedis.params.ZIncrByParams;
/**
* Common interface for sharded and non-sharded BinaryJedis
*/
public interface BinaryJedisCommands {
String set(byte[] key, byte[] value);
String set(byte[] key, byte[] value, SetParams params);
byte[] get(byte[] key);
Boolean exists(byte[] key);
Long persist(byte[] key);
String type(byte[] key);
byte[] dump(byte[] key);
String restore(byte[] key, int ttl, byte[] serializedValue);
String restoreReplace(byte[] key, int ttl, byte[] serializedValue);
Long expire(byte[] key, int seconds);
Long pexpire(byte[] key, long milliseconds);
Long expireAt(byte[] key, long unixTime);
Long pexpireAt(byte[] key, long millisecondsTimestamp);
Long ttl(byte[] key);
Long pttl(byte[] key);
Long touch(byte[] key);
Boolean setbit(byte[] key, long offset, boolean value);
Boolean setbit(byte[] key, long offset, byte[] value);
Boolean getbit(byte[] key, long offset);
Long setrange(byte[] key, long offset, byte[] value);
byte[] getrange(byte[] key, long startOffset, long endOffset);
byte[] getSet(byte[] key, byte[] value);
Long setnx(byte[] key, byte[] value);
String setex(byte[] key, int seconds, byte[] value);
String psetex(byte[] key, long milliseconds, byte[] value);
Long decrBy(byte[] key, long decrement);
Long decr(byte[] key);
Long incrBy(byte[] key, long increment);
Double incrByFloat(byte[] key, double increment);
Long incr(byte[] key);
Long append(byte[] key, byte[] value);
byte[] substr(byte[] key, int start, int end);
Long hset(byte[] key, byte[] field, byte[] value);
Long hset(byte[] key, Map<byte[], byte[]> hash);
byte[] hget(byte[] key, byte[] field);
Long hsetnx(byte[] key, byte[] field, byte[] value);
String hmset(byte[] key, Map<byte[], byte[]> hash);
List<byte[]> hmget(byte[] key, byte[]... fields);
Long hincrBy(byte[] key, byte[] field, long value);
Double hincrByFloat(byte[] key, byte[] field, double value);
Boolean hexists(byte[] key, byte[] field);
Long hdel(byte[] key, byte[]... field);
Long hlen(byte[] key);
Set<byte[]> hkeys(byte[] key);
Collection<byte[]> hvals(byte[] key);
Map<byte[], byte[]> hgetAll(byte[] key);
Long rpush(byte[] key, byte[]... args);
Long lpush(byte[] key, byte[]... args);
Long llen(byte[] key);
List<byte[]> lrange(byte[] key, long start, long stop);
String ltrim(byte[] key, long start, long stop);
byte[] lindex(byte[] key, long index);
String lset(byte[] key, long index, byte[] value);
Long lrem(byte[] key, long count, byte[] value);
byte[] lpop(byte[] key);
byte[] rpop(byte[] key);
Long sadd(byte[] key, byte[]... member);
Set<byte[]> smembers(byte[] key);
Long srem(byte[] key, byte[]... member);
byte[] spop(byte[] key);
Set<byte[]> spop(byte[] key, long count);
Long scard(byte[] key);
Boolean sismember(byte[] key, byte[] member);
byte[] srandmember(byte[] key);
List<byte[]> srandmember(byte[] key, int count);
Long strlen(byte[] key);
Long zadd(byte[] key, double score, byte[] member);
Long zadd(byte[] key, double score, byte[] member, ZAddParams params);
Long zadd(byte[] key, Map<byte[], Double> scoreMembers);
Long zadd(byte[] key, Map<byte[], Double> scoreMembers, ZAddParams params);
Set<byte[]> zrange(byte[] key, long start, long stop);
Long zrem(byte[] key, byte[]... members);
Double zincrby(byte[] key, double increment, byte[] member);
Double zincrby(byte[] key, double increment, byte[] member, ZIncrByParams params);
Long zrank(byte[] key, byte[] member);
Long zrevrank(byte[] key, byte[] member);
Set<byte[]> zrevrange(byte[] key, long start, long stop);
Set<Tuple> zrangeWithScores(byte[] key, long start, long stop);
Set<Tuple> zrevrangeWithScores(byte[] key, long start, long stop);
Long zcard(byte[] key);
Double zscore(byte[] key, byte[] member);
Set<Tuple> zpopmin(byte[] key);
Set<Tuple> zpopmin(byte[] key, long count);
List<byte[]> sort(byte[] key);
List<byte[]> sort(byte[] key, SortingParams sortingParameters);
Long zcount(byte[] key, double min, double max);
Long zcount(byte[] key, byte[] min, byte[] max);
Set<byte[]> zrangeByScore(byte[] key, double min, double max);
Set<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max);
Set<byte[]> zrevrangeByScore(byte[] key, double max, double min);
Set<byte[]> zrangeByScore(byte[] key, double min, double max, int offset, int count);
Set<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min);
Set<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count);
Set<byte[]> zrevrangeByScore(byte[] key, double max, double min, int offset, int count);
Set<Tuple> zrangeByScoreWithScores(byte[] key, double min, double max);
Set<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min);
Set<Tuple> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, int count);
Set<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count);
Set<Tuple> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max);
Set<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min);
Set<Tuple> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, int count);
Set<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count);
Set<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count);
Long zremrangeByRank(byte[] key, long start, long stop);
Long zremrangeByScore(byte[] key, double min, double max);
Long zremrangeByScore(byte[] key, byte[] min, byte[] max);
Long zlexcount(byte[] key, byte[] min, byte[] max);
Set<byte[]> zrangeByLex(byte[] key, byte[] min, byte[] max);
Set<byte[]> zrangeByLex(byte[] key, byte[] min, byte[] max, int offset,
int count);
Set<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min);
Set<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset,
int count);
Long zremrangeByLex(byte[] key, byte[] min, byte[] max);
Long linsert(byte[] key, ListPosition where, byte[] pivot, byte[] value);
Long lpushx(byte[] key, byte[]... arg);
Long rpushx(byte[] key, byte[]... arg);
Long del(byte[] key);
Long unlink(byte[] key);
byte[] echo(byte[] arg);
Long move(byte[] key, int dbIndex);
Long bitcount(byte[] key);
Long bitcount(byte[] key, long start, long end);
Long pfadd(byte[] key, byte[]... elements);
long pfcount(byte[] key);
// Geo Commands
Long geoadd(byte[] key, double longitude, double latitude, byte[] member);
Long geoadd(byte[] key, Map<byte[], GeoCoordinate> memberCoordinateMap);
Double geodist(byte[] key, byte[] member1, byte[] member2);
Double geodist(byte[] key, byte[] member1, byte[] member2, GeoUnit unit);
List<byte[]> geohash(byte[] key, byte[]... members);
List<GeoCoordinate> geopos(byte[] key, byte[]... members);
List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius,
GeoUnit unit);
List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius,
GeoUnit unit);
List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius,
GeoUnit unit, GeoRadiusParam param);
List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius,
GeoUnit unit, GeoRadiusParam param);
List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit);
List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit);
List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit,
GeoRadiusParam param);
List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit,
GeoRadiusParam param);
ScanResult<Map.Entry<byte[], byte[]>> hscan(byte[] key, byte[] cursor);
ScanResult<Map.Entry<byte[], byte[]>> hscan(byte[] key, byte[] cursor, ScanParams params);
ScanResult<byte[]> sscan(byte[] key, byte[] cursor);
ScanResult<byte[]> sscan(byte[] key, byte[] cursor, ScanParams params);
ScanResult<Tuple> zscan(byte[] key, byte[] cursor);
ScanResult<Tuple> zscan(byte[] key, byte[] cursor, ScanParams params);
/**
* Executes BITFIELD Redis command
* @param key
* @param arguments
* @return
*/
List<Long> bitfield(byte[] key, byte[]... arguments);
/**
* Used for HSTRLEN Redis command
* @param key
* @param field
* @return lenth of the value for key
*/
Long hstrlen(byte[] key, byte[] field);
byte[] xadd(final byte[] key, final byte[] id, final Map<byte[], byte[]> hash, long maxLen, boolean approximateLength);
Long xlen(final byte[] key);
List<byte[]> xrange(final byte[] key, final byte[] start, final byte[] end, final long count);
List<byte[]> xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count);
Long xack(final byte[] key, final byte[] group, final byte[]... ids);
String xgroupCreate(final byte[] key, final byte[] consumer, final byte[] id, boolean makeStream);
String xgroupSetID(final byte[] key, final byte[] consumer, final byte[] id);
Long xgroupDestroy(final byte[] key, final byte[] consumer);
String xgroupDelConsumer(final byte[] key, final byte[] consumer, final byte[] consumerName);
Long xdel(final byte[] key, final byte[]... ids);
Long xtrim(byte[] key, long maxLen, boolean approximateLength);
List<byte[]> xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername);
List<byte[]> xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[][] ids);
}