Skip to content

Commit 550d16d

Browse files
committed
Merge remote-tracking branch 'redis/master' into xread-block-2
2 parents 3ead3de + 34270c7 commit 550d16d

39 files changed

+1221
-174
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
with:
16+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
17+
config-name: release-drafter-config.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+

src/main/java/redis/clients/jedis/BinaryClient.java

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ public void getDel(final byte[] key) {
189189
sendCommand(GETDEL, key);
190190
}
191191

192+
public void getEx(final byte[] key, final GetExParams params) {
193+
sendCommand(GETEX, params.getByteParams(key));
194+
}
195+
192196
public void quit() {
193197
db = 0;
194198
sendCommand(QUIT);
@@ -559,6 +563,10 @@ public void zadd(final byte[] key, final Map<byte[], Double> scoreMembers, final
559563
sendCommand(ZADD, params.getByteParams(key, argsArray));
560564
}
561565

566+
public void zaddIncr(final byte[] key, final double score, final byte[] member, final ZAddParams params) {
567+
sendCommand(ZADD, params.getByteParams(key, INCR.getRaw(), toByteArray(score), member));
568+
}
569+
562570
public void zrange(final byte[] key, final long start, final long stop) {
563571
sendCommand(ZRANGE, key, toByteArray(start), toByteArray(stop));
564572
}
@@ -675,6 +683,22 @@ public void blpop(final int timeout, final byte[]... keys) {
675683
blpop(args.toArray(new byte[args.size()][]));
676684
}
677685

686+
public void bzpopmax(final int timeout, final byte[]... keys) {
687+
final List<byte[]> args = new ArrayList<>();
688+
Collections.addAll(args, keys);
689+
690+
args.add(Protocol.toByteArray(timeout));
691+
sendCommand(BZPOPMAX, args.toArray(new byte[args.size()][]));
692+
}
693+
694+
public void bzpopmin(final int timeout, final byte[]... keys) {
695+
final List<byte[]> args = new ArrayList<>();
696+
Collections.addAll(args, keys);
697+
698+
args.add(Protocol.toByteArray(timeout));
699+
sendCommand(BZPOPMIN, args.toArray(new byte[args.size()][]));
700+
}
701+
678702
public void sort(final byte[] key, final SortingParams sortingParameters, final byte[] dstkey) {
679703
final List<byte[]> args = new ArrayList<>();
680704
args.add(key);
@@ -1296,14 +1320,17 @@ public void geoadd(final byte[] key, final double longitude, final double latitu
12961320
}
12971321

12981322
public void geoadd(final byte[] key, final Map<byte[], GeoCoordinate> memberCoordinateMap) {
1299-
List<byte[]> args = new ArrayList<>(memberCoordinateMap.size() * 3 + 1);
1300-
args.add(key);
1323+
geoadd(key, GeoAddParams.geoAddParams(), memberCoordinateMap);
1324+
}
1325+
1326+
public void geoadd(final byte[] key, final GeoAddParams params, final Map<byte[], GeoCoordinate> memberCoordinateMap) {
1327+
List<byte[]> args = new ArrayList<>(memberCoordinateMap.size() * 3);
13011328
args.addAll(convertGeoCoordinateMapToByteArrays(memberCoordinateMap));
13021329

13031330
byte[][] argsArray = new byte[args.size()][];
13041331
args.toArray(argsArray);
13051332

1306-
sendCommand(GEOADD, argsArray);
1333+
sendCommand(GEOADD, params.getByteParams(key, argsArray));
13071334
}
13081335

13091336
public void geodist(final byte[] key, final byte[] member1, final byte[] member2) {
@@ -1456,6 +1483,14 @@ public void aclDelUser(final byte[] name) {
14561483
sendCommand(ACL, Keyword.DELUSER.getRaw(), name);
14571484
}
14581485

1486+
public void aclLoad() {
1487+
sendCommand(ACL, Keyword.LOAD.getRaw());
1488+
}
1489+
1490+
public void aclSave() {
1491+
sendCommand(ACL, Keyword.SAVE.getRaw());
1492+
}
1493+
14591494
private List<byte[]> convertGeoCoordinateMapToByteArrays(
14601495
final Map<byte[], GeoCoordinate> memberCoordinateMap) {
14611496
List<byte[]> args = new ArrayList<>(memberCoordinateMap.size() * 3);
@@ -1697,6 +1732,10 @@ public void xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int
16971732
}
16981733
}
16991734

1735+
public void xpendingSummary(final byte[] key, final byte[] groupname) {
1736+
sendCommand(XPENDING, key, groupname);
1737+
}
1738+
17001739
public void xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime,
17011740
long newIdleTime, int retries, boolean force, byte[][] ids) {
17021741

src/main/java/redis/clients/jedis/BinaryJedis.java

Lines changed: 80 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ public byte[] getDel(final byte[] key) {
407407
return client.getBinaryBulkReply();
408408
}
409409

410+
@Override
411+
public byte[] getEx(final byte[] key, final GetExParams params) {
412+
checkIsInMultiOrPipeline();
413+
client.getEx(key, params);
414+
return client.getBinaryBulkReply();
415+
}
416+
410417
/**
411418
* Ask the server to silently close the connection.
412419
*/
@@ -1834,14 +1841,14 @@ public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
18341841
* Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
18351842
* <p>
18361843
* <b>Example:</b>
1837-
*
1844+
*
18381845
* <pre>
18391846
* key1 = [x, a, b, c]
18401847
* key2 = [c]
18411848
* key3 = [a, d]
18421849
* SDIFF key1,key2,key3 =&gt; [x, b]
18431850
* </pre>
1844-
*
1851+
*
18451852
* Non existing keys are considered like empty sets.
18461853
* <p>
18471854
* <b>Time complexity:</b>
@@ -1941,6 +1948,13 @@ public Long zadd(final byte[] key, final Map<byte[], Double> scoreMembers, final
19411948
return client.getIntegerReply();
19421949
}
19431950

1951+
@Override
1952+
public Double zaddIncr(final byte[] key, final double score, final byte[] member, final ZAddParams params) {
1953+
checkIsInMultiOrPipeline();
1954+
client.zaddIncr(key, score, member, params);
1955+
return BuilderFactory.DOUBLE.build(client.getOne());
1956+
}
1957+
19441958
@Override
19451959
public Set<byte[]> zrange(final byte[] key, final long start, final long stop) {
19461960
checkIsInMultiOrPipeline();
@@ -2199,65 +2213,65 @@ public List<byte[]> sort(final byte[] key) {
21992213
* <b>examples:</b>
22002214
* <p>
22012215
* Given are the following sets and key/values:
2202-
*
2216+
*
22032217
* <pre>
22042218
* x = [1, 2, 3]
22052219
* y = [a, b, c]
2206-
*
2220+
*
22072221
* k1 = z
22082222
* k2 = y
22092223
* k3 = x
2210-
*
2224+
*
22112225
* w1 = 9
22122226
* w2 = 8
22132227
* w3 = 7
22142228
* </pre>
2215-
*
2229+
*
22162230
* Sort Order:
2217-
*
2231+
*
22182232
* <pre>
22192233
* sort(x) or sort(x, sp.asc())
22202234
* -&gt; [1, 2, 3]
2221-
*
2235+
*
22222236
* sort(x, sp.desc())
22232237
* -&gt; [3, 2, 1]
2224-
*
2238+
*
22252239
* sort(y)
22262240
* -&gt; [c, a, b]
2227-
*
2241+
*
22282242
* sort(y, sp.alpha())
22292243
* -&gt; [a, b, c]
2230-
*
2244+
*
22312245
* sort(y, sp.alpha().desc())
22322246
* -&gt; [c, a, b]
22332247
* </pre>
2234-
*
2248+
*
22352249
* Limit (e.g. for Pagination):
2236-
*
2250+
*
22372251
* <pre>
22382252
* sort(x, sp.limit(0, 2))
22392253
* -&gt; [1, 2]
2240-
*
2254+
*
22412255
* sort(y, sp.alpha().desc().limit(1, 2))
22422256
* -&gt; [b, a]
22432257
* </pre>
2244-
*
2258+
*
22452259
* Sorting by external keys:
2246-
*
2260+
*
22472261
* <pre>
22482262
* sort(x, sb.by(w*))
22492263
* -&gt; [3, 2, 1]
2250-
*
2264+
*
22512265
* sort(x, sb.by(w*).desc())
22522266
* -&gt; [1, 2, 3]
22532267
* </pre>
2254-
*
2268+
*
22552269
* Getting external keys:
2256-
*
2270+
*
22572271
* <pre>
22582272
* sort(x, sp.by(w*).get(k*))
22592273
* -&gt; [x, y, z]
2260-
*
2274+
*
22612275
* sort(x, sp.by(w*).get(#).get(k*))
22622276
* -&gt; [3, x, 2, y, 1, z]
22632277
* </pre>
@@ -2341,6 +2355,20 @@ public List<byte[]> blpop(final int timeout, final byte[]... keys) {
23412355
return blpop(getArgsAddTimeout(timeout, keys));
23422356
}
23432357

2358+
@Override
2359+
public KeyedTuple bzpopmax(final int timeout, final byte[]... keys) {
2360+
checkIsInMultiOrPipeline();
2361+
client.bzpopmax(timeout, keys);
2362+
return BuilderFactory.KEYED_TUPLE.build(client.getBinaryMultiBulkReply());
2363+
}
2364+
2365+
@Override
2366+
public KeyedTuple bzpopmin(final int timeout, final byte[]... keys) {
2367+
checkIsInMultiOrPipeline();
2368+
client.bzpopmin(timeout, keys);
2369+
return BuilderFactory.KEYED_TUPLE.build(client.getBinaryMultiBulkReply());
2370+
}
2371+
23442372
private byte[][] getArgsAddTimeout(int timeout, byte[][] keys) {
23452373
int size = keys.length;
23462374
final byte[][] args = new byte[size + 1][];
@@ -3192,7 +3220,7 @@ public String shutdown() {
31923220
* <b>Format of the returned String:</b>
31933221
* <p>
31943222
* All the fields are in the form field:value
3195-
*
3223+
*
31963224
* <pre>
31973225
* edis_version:0.07
31983226
* connected_clients:1
@@ -3205,7 +3233,7 @@ public String shutdown() {
32053233
* uptime_in_seconds:25
32063234
* uptime_in_days:0
32073235
* </pre>
3208-
*
3236+
*
32093237
* <b>Notes</b>
32103238
* <p>
32113239
* used_memory is returned in bytes, and is the total number of bytes allocated by the program
@@ -3287,7 +3315,7 @@ public String slaveofNoOne() {
32873315
* are reported as a list of key-value pairs.
32883316
* <p>
32893317
* <b>Example:</b>
3290-
*
3318+
*
32913319
* <pre>
32923320
* $ redis-cli config get '*'
32933321
* 1. "dbfilename"
@@ -3302,7 +3330,7 @@ public String slaveofNoOne() {
33023330
* 10. "everysec"
33033331
* 11. "save"
33043332
* 12. "3600 1 300 100 60 10000"
3305-
*
3333+
*
33063334
* $ redis-cli config get 'm*'
33073335
* 1. "masterauth"
33083336
* 2. (nil)
@@ -3934,6 +3962,20 @@ public byte[] aclLog(byte[] options) {
39343962
return client.getBinaryBulkReply();
39353963
}
39363964

3965+
@Override
3966+
public String aclLoad() {
3967+
checkIsInMultiOrPipeline();
3968+
client.aclLoad();
3969+
return client.getStatusCodeReply();
3970+
}
3971+
3972+
@Override
3973+
public String aclSave() {
3974+
checkIsInMultiOrPipeline();
3975+
client.aclSave();
3976+
return client.getStatusCodeReply();
3977+
}
3978+
39373979
@Override
39383980
public String clientKill(final byte[] ipPort) {
39393981
checkIsInMultiOrPipeline();
@@ -4135,6 +4177,13 @@ public Long geoadd(final byte[] key, final Map<byte[], GeoCoordinate> memberCoor
41354177
return client.getIntegerReply();
41364178
}
41374179

4180+
@Override
4181+
public Long geoadd(final byte[] key, final GeoAddParams params, final Map<byte[], GeoCoordinate> memberCoordinateMap) {
4182+
checkIsInMultiOrPipeline();
4183+
client.geoadd(key, params, memberCoordinateMap);
4184+
return client.getIntegerReply();
4185+
}
4186+
41384187
@Override
41394188
public Double geodist(final byte[] key, final byte[] member1, final byte[] member2) {
41404189
checkIsInMultiOrPipeline();
@@ -4519,6 +4568,13 @@ public List<Object> xpending(byte[] key, byte[] groupname, byte[] start, byte[]
45194568
return client.getObjectMultiBulkReply();
45204569
}
45214570

4571+
@Override
4572+
public Object xpendingSummary(final byte[] key, final byte[] groupname) {
4573+
checkIsInMultiOrPipeline();
4574+
client.xpendingSummary(key, groupname);
4575+
return client.getOne();
4576+
}
4577+
45224578
@Override
45234579
public List<byte[]> xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime,
45244580
long newIdleTime, int retries, boolean force, byte[]... ids) {

0 commit comments

Comments
 (0)