Skip to content

Commit 67a17bb

Browse files
committed
address review: add deprecation tags and comments
1 parent f35484c commit 67a17bb

File tree

6 files changed

+59
-4
lines changed

6 files changed

+59
-4
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,11 @@ public void xrevrange(final byte[] key, final byte[] end, final byte[] start, fi
15671567
sendCommand(XREVRANGE, key, end, start, Keyword.COUNT.getRaw(), toByteArray(count));
15681568
}
15691569

1570+
/**
1571+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
1572+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map.Entry...)}.
1573+
*/
1574+
@Deprecated
15701575
public void xread(final int count, final long block, final Map<byte[], byte[]> streams) {
15711576
final byte[][] params = new byte[3 + streams.size() * 2 + (block > 0 ? 2 : 0)][];
15721577

@@ -1657,6 +1662,11 @@ public void xtrim(byte[] key, long maxLen, boolean approximateLength) {
16571662
}
16581663
}
16591664

1665+
/**
1666+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
1667+
* {@link #xreadGroup(byte..., byte..., redis.clients.jedis.params.XReadGroupParams, java.util.Map.Entry...)}.
1668+
*/
1669+
@Deprecated
16601670
public void xreadGroup(byte[] groupname, byte[] consumer, int count, long block, boolean noAck,
16611671
Map<byte[], byte[]> streams) {
16621672

src/main/java/redis/clients/jedis/commands/Commands.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ default void restoreReplace(String key, int ttl, byte[] serializedValue) {
435435

436436
void xrevrange(String key, StreamEntryID end, StreamEntryID start, int count);
437437

438+
/**
439+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
440+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map)}.
441+
*/
442+
@Deprecated
438443
void xread(int count, long block, Entry<String, StreamEntryID>... streams);
439444

440445
void xread(XReadParams params, Map<String, StreamEntryID> streams);
@@ -453,6 +458,11 @@ default void restoreReplace(String key, int ttl, byte[] serializedValue) {
453458

454459
void xtrim(String key, long maxLen, boolean approximateLength);
455460

461+
/**
462+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
463+
* {@link #xreadGroup(java.lang.String, java.lang.String, redis.clients.jedis.params.XReadGroupParams, java.util.Map)}.
464+
*/
465+
@Deprecated
456466
void xreadGroup(String groupname, String consumer, int count, long block, boolean noAck, Entry<String, StreamEntryID>... streams);
457467

458468
void xreadGroup(String groupname, String consumer, XReadGroupParams params, Map<String, StreamEntryID> streams);

src/main/java/redis/clients/jedis/commands/MultiKeyBinaryCommands.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,20 @@ public interface MultiKeyBinaryCommands {
9797

9898
Long touch(byte[]... keys);
9999

100+
/**
101+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
102+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map.Entry...)}.
103+
*/
104+
@Deprecated
100105
List<byte[]> xread(int count, long block, Map<byte[], byte[]> streams);
101106

102107
List<byte[]> xread(XReadParams xReadParams, Entry<byte[], byte[]>... streams);
103108

109+
/**
110+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
111+
* {@link #xreadGroup(byte..., byte..., redis.clients.jedis.params.XReadGroupParams, java.util.Map.Entry...)}.
112+
*/
113+
@Deprecated
104114
List<byte[]> xreadGroup(byte[] groupname, byte[] consumer, int count, long block, boolean noAck,
105115
Map<byte[], byte[]> streams);
106116

src/main/java/redis/clients/jedis/commands/MultiKeyBinaryJedisClusterCommands.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,20 @@ public interface MultiKeyBinaryJedisClusterCommands {
9191

9292
Set<byte[]> keys(byte[] pattern);
9393

94+
/**
95+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
96+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map.Entry...)}.
97+
*/
98+
@Deprecated
9499
List<byte[]> xread(int count, long block, Map<byte[], byte[]> streams);
95100

96101
List<byte[]> xread(XReadParams xReadParams, Entry<byte[], byte[]>... streams);
97-
102+
103+
/**
104+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
105+
* {@link #xreadGroup(byte..., byte..., redis.clients.jedis.params.XReadGroupParams, java.util.Map.Entry...)}.
106+
*/
107+
@Deprecated
98108
List<byte[]> xreadGroup(byte[] groupname, byte[] consumer, int count, long block, boolean noAck,
99109
Map<byte[], byte[]> streams);
100110

src/main/java/redis/clients/jedis/commands/MultiKeyCommands.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,15 @@ public interface MultiKeyCommands {
190190
* @param block
191191
* @param streams
192192
* @return
193+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
194+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map)}.
193195
*/
196+
@Deprecated
194197
List<Map.Entry<String, List<StreamEntry>>> xread(int count, long block,
195198
Map.Entry<String, StreamEntryID>... streams);
196199

197-
List<Map.Entry<String, List<StreamEntry>>> xread(XReadParams xReadParams, Map<String, StreamEntryID> streams);
200+
List<Map.Entry<String, List<StreamEntry>>> xread(XReadParams xReadParams,
201+
Map<String, StreamEntryID> streams);
198202

199203
/**
200204
* XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
@@ -206,7 +210,10 @@ List<Map.Entry<String, List<StreamEntry>>> xread(int count, long block,
206210
* @param noAck
207211
* @param streams
208212
* @return
213+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
214+
* {@link #xreadGroup(java.lang.String, java.lang.String, redis.clients.jedis.params.XReadGroupParams, java.util.Map)}.
209215
*/
216+
@Deprecated
210217
List<Map.Entry<String, List<StreamEntry>>> xreadGroup(String groupname, String consumer,
211218
int count, long block, boolean noAck, Map.Entry<String, StreamEntryID>... streams);
212219

src/main/java/redis/clients/jedis/commands/MultiKeyJedisClusterCommands.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,15 @@ Long georadiusByMemberStore(String key, String member, double radius, GeoUnit un
106106
* @param block
107107
* @param streams
108108
* @return
109+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
110+
* {@link #xread(redis.clients.jedis.params.XReadParams, java.util.Map)}.
109111
*/
112+
@Deprecated
110113
List<Map.Entry<String, List<StreamEntry>>> xread(int count, long block,
111114
Map.Entry<String, StreamEntryID>... streams);
112115

113-
List<Map.Entry<String, List<StreamEntry>>> xread(XReadParams xReadParams, Map<String, StreamEntryID> streams);
116+
List<Map.Entry<String, List<StreamEntry>>> xread(XReadParams xReadParams,
117+
Map<String, StreamEntryID> streams);
114118

115119
/**
116120
* XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
@@ -122,10 +126,14 @@ List<Map.Entry<String, List<StreamEntry>>> xread(int count, long block,
122126
* @param noAck
123127
* @param streams
124128
* @return
129+
* @deprecated This method will be removed due to bug regarding {@code block} param. Use
130+
* {@link #xreadGroup(java.lang.String, java.lang.String, redis.clients.jedis.params.XReadGroupParams, java.util.Map)}.
125131
*/
132+
@Deprecated
126133
List<Map.Entry<String, List<StreamEntry>>> xreadGroup(String groupname, String consumer,
127134
int count, long block, boolean noAck, Map.Entry<String, StreamEntryID>... streams);
128135

129-
List<Map.Entry<String, List<StreamEntry>>> xreadGroup(String groupname, String consumer, XReadGroupParams xReadGroupParams, Map<String, StreamEntryID> streams);
136+
List<Map.Entry<String, List<StreamEntry>>> xreadGroup(String groupname, String consumer,
137+
XReadGroupParams xReadGroupParams, Map<String, StreamEntryID> streams);
130138

131139
}

0 commit comments

Comments
 (0)