Skip to content

Commit

Permalink
Add zaddIncr, xpendingSummary methods to PipelineBase (#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
dengliming committed Mar 11, 2021
1 parent f404976 commit 5e99d53
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/java/redis/clients/jedis/PipelineBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,18 @@ public Response<Long> zadd(final byte[] key, final Map<byte[], Double> scoreMemb
return getResponse(BuilderFactory.LONG);
}

@Override
public Response<Double> zaddIncr(String key, double score, String member, ZAddParams params) {
getClient(key).zaddIncr(key, score, member, params);
return getResponse(BuilderFactory.DOUBLE);
}

@Override
public Response<Double> zaddIncr(byte[] key, double score, byte[] member, ZAddParams params) {
getClient(key).zaddIncr(key, score, member, params);
return getResponse(BuilderFactory.DOUBLE);
}

@Override
public Response<Long> zcard(final String key) {
getClient(key).zcard(key);
Expand Down Expand Up @@ -2146,6 +2158,18 @@ public Response<List<Object>> xpendingBinary(byte[] key, byte[] groupname, byte[
return getResponse(BuilderFactory.OBJECT_LIST);
}

@Override
public Response<StreamPendingSummary> xpendingSummary(String key, String groupname) {
getClient(key).xpendingSummary(key, groupname);
return getResponse(BuilderFactory.STREAM_PENDING_SUMMARY);
}

@Override
public Response<Object> xpendingSummary(byte[] key, byte[] groupname) {
getClient(key).xpendingSummary(key, groupname);
return getResponse(BuilderFactory.OBJECT);
}

@Override
public Response<Long> xdel(String key, StreamEntryID... ids) {
getClient(key).xdel(key, ids);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ default Response<String> setex(byte[] key, int seconds, byte[] value) {

Response<Long> zadd(byte[] key, Map<byte[], Double> scoreMembers, ZAddParams params);

Response<Double> zaddIncr(byte[] key, double score, byte[] member, ZAddParams params);

Response<Long> zcard(byte[] key);

Response<Long> zcount(byte[] key, double min, double max);
Expand Down Expand Up @@ -389,6 +391,8 @@ Response<List<GeoRadiusResponse>> georadiusByMemberReadonly(byte[] key, byte[] m

Response<List<Object>> xpendingBinary(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername);

Response<Object> xpendingSummary(byte[] key, byte[] groupname);

Response<Long> xdel(byte[] key, byte[]... ids);

Response<Long> xtrim(byte[] key, long maxLen, boolean approximateLength);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/redis/clients/jedis/commands/RedisPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import redis.clients.jedis.Response;
import redis.clients.jedis.SortingParams;
import redis.clients.jedis.StreamEntry;
import redis.clients.jedis.StreamPendingSummary;
import redis.clients.jedis.Tuple;
import redis.clients.jedis.params.GeoRadiusParam;
import redis.clients.jedis.params.GetExParams;
Expand Down Expand Up @@ -199,6 +200,8 @@ default Response<String> setex(String key, int seconds, String value) {

Response<Long> zadd(String key, Map<String, Double> scoreMembers, ZAddParams params);

Response<Double> zaddIncr(String key, double score, String member, ZAddParams params);

Response<Long> zcard(String key);

Response<Long> zcount(String key, double min, double max);
Expand Down Expand Up @@ -380,6 +383,8 @@ Response<List<GeoRadiusResponse>> georadiusByMemberReadonly(String key, String m
Response<List<StreamPendingEntry>> xpending(String key, String groupname,
StreamEntryID start, StreamEntryID end, int count, String consumername);

Response<StreamPendingSummary> xpendingSummary(String key, String groupname);

Response<Long> xdel( String key, StreamEntryID... ids);

Response<Long> xtrim( String key, long maxLen, boolean approximateLength);
Expand Down

0 comments on commit 5e99d53

Please sign in to comment.