Skip to content

Commit

Permalink
Fix xrevrange in PipelineBase (#2436)
Browse files Browse the repository at this point in the history
  • Loading branch information
dengliming authored and sazzad16 committed Mar 15, 2021
1 parent af9e908 commit 1bc0f1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/redis/clients/jedis/PipelineBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1997,15 +1997,16 @@ public Response<List<byte[]>> xrange(byte[] key, byte[] start, byte[] end, int c
}

@Override
public Response<List<StreamEntry>> xrevrange(String key, StreamEntryID end, StreamEntryID start, int count){
getClient(key).xrevrange(key, start, end, count);
return getResponse(BuilderFactory.STREAM_ENTRY_LIST);
public Response<List<StreamEntry>> xrevrange(String key, StreamEntryID end, StreamEntryID start,
int count) {
getClient(key).xrevrange(key, end, start, count);
return getResponse(BuilderFactory.STREAM_ENTRY_LIST);
}

@Override
public Response<List<byte[]>> xrevrange(byte[] key, byte[] end, byte[] start, int count){
getClient(key).xrevrange(key, start, end, count);
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
public Response<List<byte[]>> xrevrange(byte[] key, byte[] end, byte[] start, int count) {
getClient(key).xrevrange(key, end, start, count);
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ public void pipeline() {
assertEquals(map, entries.get(0).getFields());
assertEquals(id2.get(), entries.get(1).getID());
assertEquals(map, entries.get(1).getFields());

p = jedis.pipelined();
Response<List<StreamEntry>> results2 = p.xrevrange("stream1", null, id1.get(), 2);
p.sync();
assertEquals(2, results2.get().size());
}

@Test
Expand Down

0 comments on commit 1bc0f1f

Please sign in to comment.