diff --git a/pom.xml b/pom.xml index 1f0d73253d..b063505409 100644 --- a/pom.xml +++ b/pom.xml @@ -129,8 +129,8 @@ maven-compiler-plugin 3.8.1 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/src/main/java/redis/clients/jedis/BinaryClient.java b/src/main/java/redis/clients/jedis/BinaryClient.java index 7c2b99c82e..8487c05a7f 100644 --- a/src/main/java/redis/clients/jedis/BinaryClient.java +++ b/src/main/java/redis/clients/jedis/BinaryClient.java @@ -193,10 +193,18 @@ public void dbSize() { sendCommand(DBSIZE); } + /** + * @deprecated Use {@link #expire(byte[], long)}. + */ + @Deprecated public void expire(final byte[] key, final int seconds) { sendCommand(EXPIRE, key, toByteArray(seconds)); } + public void expire(final byte[] key, final long seconds) { + sendCommand(EXPIRE, key, toByteArray(seconds)); + } + public void expireAt(final byte[] key, final long unixTime) { sendCommand(EXPIREAT, key, toByteArray(unixTime)); } @@ -237,10 +245,18 @@ public void setnx(final byte[] key, final byte[] value) { sendCommand(SETNX, key, value); } + /** + * @deprecated Use {@link #setex(byte[], long, byte[])}. + */ + @Deprecated public void setex(final byte[] key, final int seconds, final byte[] value) { sendCommand(SETEX, key, toByteArray(seconds), value); } + public void setex(final byte[] key, final long seconds, final byte[] value) { + sendCommand(SETEX, key, toByteArray(seconds), value); + } + public void mset(final byte[]... keysvalues) { sendCommand(MSET, keysvalues); } @@ -1068,14 +1084,30 @@ public void dump(final byte[] key) { sendCommand(DUMP, key); } + /** + * @deprecated Use {@link #restore(byte[], long, byte[])}. + */ + @Deprecated public void restore(final byte[] key, final int ttl, final byte[] serializedValue) { sendCommand(RESTORE, key, toByteArray(ttl), serializedValue); } + public void restore(final byte[] key, final long ttl, final byte[] serializedValue) { + sendCommand(RESTORE, key, toByteArray(ttl), serializedValue); + } + + /** + * @deprecated Use {@link #restoreReplace(byte[], long, byte[])}. + */ + @Deprecated public void restoreReplace(final byte[] key, final int ttl, final byte[] serializedValue) { sendCommand(RESTORE, key, toByteArray(ttl), serializedValue, Keyword.REPLACE.getRaw()); } + public void restoreReplace(final byte[] key, final long ttl, final byte[] serializedValue) { + sendCommand(RESTORE, key, toByteArray(ttl), serializedValue, Keyword.REPLACE.getRaw()); + } + public void pexpire(final byte[] key, final long milliseconds) { sendCommand(PEXPIRE, key, toByteArray(milliseconds)); } @@ -1441,11 +1473,19 @@ public void xadd(final byte[] key, final byte[] id, final Map ha public void xlen(final byte[] key) { sendCommand(XLEN, key); } - - public void xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { - sendCommand(XRANGE, key, start, end, Keyword.COUNT.getRaw(), toByteArray(count)); + + /** + * @deprecated Use {@link #xrange(byte[], byte[], byte[], int)}. + */ + @Deprecated + public void xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { + sendCommand(XRANGE, key, start, end, Keyword.COUNT.getRaw(), toByteArray(count)); } - + + public void xrange(final byte[] key, final byte[] start, final byte[] end, final int count) { + sendCommand(XRANGE, key, start, end, Keyword.COUNT.getRaw(), toByteArray(count)); + } + public void xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count) { sendCommand(XREVRANGE, key, end, start, Keyword.COUNT.getRaw(), toByteArray(count)); } diff --git a/src/main/java/redis/clients/jedis/BinaryJedis.java b/src/main/java/redis/clients/jedis/BinaryJedis.java index 1e5427ccb0..28197129cb 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedis.java +++ b/src/main/java/redis/clients/jedis/BinaryJedis.java @@ -539,7 +539,7 @@ public Long dbSize() { * 2.1.3, Redis >= 2.1.3 will happily update the timeout), or the key does not exist. */ @Override - public Long expire(final byte[] key, final int seconds) { + public Long expire(final byte[] key, final long seconds) { checkIsInMultiOrPipeline(); client.expire(key, seconds); return client.getIntegerReply(); @@ -724,7 +724,7 @@ public Long setnx(final byte[] key, final byte[] value) { * @return Status code reply */ @Override - public String setex(final byte[] key, final int seconds, final byte[] value) { + public String setex(final byte[] key, final long seconds, final byte[] value) { checkIsInMultiOrPipeline(); client.setex(key, seconds, value); return client.getStatusCodeReply(); @@ -3680,14 +3680,14 @@ public byte[] dump(final byte[] key) { } @Override - public String restore(final byte[] key, final int ttl, final byte[] serializedValue) { + public String restore(final byte[] key, final long ttl, final byte[] serializedValue) { checkIsInMultiOrPipeline(); client.restore(key, ttl, serializedValue); return client.getStatusCodeReply(); } @Override - public String restoreReplace(final byte[] key, final int ttl, final byte[] serializedValue) { + public String restoreReplace(final byte[] key, final long ttl, final byte[] serializedValue) { checkIsInMultiOrPipeline(); client.restoreReplace(key, ttl, serializedValue); return client.getStatusCodeReply(); @@ -4337,7 +4337,7 @@ public Long xlen(byte[] key) { } @Override - public List xrange(byte[] key, byte[] start, byte[] end, long count) { + public List xrange(byte[] key, byte[] start, byte[] end, int count) { checkIsInMultiOrPipeline(); client.xrange(key, start, end, count); return client.getBinaryMultiBulkReply(); @@ -4400,42 +4400,61 @@ public Long xtrim(byte[] key, long maxLen, boolean approximateLength) { } @Override - public List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername) { + public List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername) { checkIsInMultiOrPipeline(); client.xpending(key, groupname, start, end, count, consumername); - return client.getBinaryMultiBulkReply(); } + return client.getObjectMultiBulkReply(); + } @Override - public List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[][] ids){ + public List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[]... ids) { checkIsInMultiOrPipeline(); client.xclaim(key, groupname, consumername, minIdleTime, newIdleTime, retries, force, ids); - return client.getBinaryMultiBulkReply(); + return client.getBinaryMultiBulkReply(); } @Override public StreamInfo xinfoStream(byte[] key) { checkIsInMultiOrPipeline(); client.xinfoStream(key); - return BuilderFactory.STREAM_INFO.build(client.getOne()); + } + @Override + public Object xinfoStreamBinary(byte[] key) { + checkIsInMultiOrPipeline(); + client.xinfoStream(key); + return client.getOne(); } @Override - public List xinfoGroup (byte[] key) { + public List xinfoGroup(byte[] key) { checkIsInMultiOrPipeline(); client.xinfoGroup(key); - return BuilderFactory.STREAM_GROUP_INFO_LIST.build(client.getBinaryMultiBulkReply()); } + @Override - public List xinfoConsumers (byte[] key, byte[] group) { + public List xinfoGroupBinary(byte[] key) { checkIsInMultiOrPipeline(); - client.xinfoConsumers(key,group); + client.xinfoGroup(key); + return client.getObjectMultiBulkReply(); + } + @Override + public List xinfoConsumers(byte[] key, byte[] group) { + checkIsInMultiOrPipeline(); + client.xinfoConsumers(key, group); return BuilderFactory.STREAM_CONSUMERS_INFO_LIST.build(client.getBinaryMultiBulkReply()); } + @Override + public List xinfoConsumersBinary(byte[] key, byte[] group) { + checkIsInMultiOrPipeline(); + client.xinfoConsumers(key, group); + return client.getObjectMultiBulkReply(); + } + public Object sendCommand(ProtocolCommand cmd, byte[]... args) { checkIsInMultiOrPipeline(); client.sendCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index 1f36beb2bd..e48188ef1a 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -213,7 +213,7 @@ public byte[] execute(Jedis connection) { } @Override - public String restore(final byte[] key, final int ttl, final byte[] serializedValue) { + public String restore(final byte[] key, final long ttl, final byte[] serializedValue) { return new JedisClusterCommand(connectionHandler, maxAttempts) { @Override public String execute(Jedis connection) { @@ -383,7 +383,7 @@ public String execute(Jedis connection) { } @Override - public String setex(final byte[] key, final int seconds, final byte[] value) { + public String setex(final byte[] key, final long seconds, final byte[] value) { return new JedisClusterCommand(connectionHandler, maxAttempts) { @Override public String execute(Jedis connection) { @@ -2266,6 +2266,16 @@ public List execute(Jedis connection) { }.runBinary(key); } + @Override + public List xrange(final byte[] key, final byte[] start, final byte[] end, final int count) { + return new JedisClusterCommand>(connectionHandler, maxAttempts) { + @Override + public List execute(Jedis connection) { + return connection.xrange(key, start, end, count); + } + }.runBinary(key); + } + @Override public List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count) { return new JedisClusterCommand>(connectionHandler, maxAttempts) { @@ -2373,11 +2383,11 @@ public Long execute(Jedis connection) { } @Override - public List xpending(final byte[] key, final byte[] groupname, final byte[] start, final byte[] end, + public List xpending(final byte[] key, final byte[] groupname, final byte[] start, final byte[] end, final int count, final byte[] consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts) { @Override - public List execute(Jedis connection) { + public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); } }.runBinary(key); diff --git a/src/main/java/redis/clients/jedis/BinaryShardedJedis.java b/src/main/java/redis/clients/jedis/BinaryShardedJedis.java index 7e32382c98..aedc646fda 100644 --- a/src/main/java/redis/clients/jedis/BinaryShardedJedis.java +++ b/src/main/java/redis/clients/jedis/BinaryShardedJedis.java @@ -110,19 +110,19 @@ public byte[] dump(final byte[] key) { } @Override - public String restore(final byte[] key, final int ttl, final byte[] serializedValue) { + public String restore(final byte[] key, final long ttl, final byte[] serializedValue) { Jedis j = getShard(key); return j.restore(key, ttl, serializedValue); } @Override - public String restoreReplace(final byte[] key, final int ttl, final byte[] serializedValue) { + public String restoreReplace(final byte[] key, final long ttl, final byte[] serializedValue) { Jedis j = getShard(key); return j.restoreReplace(key, ttl, serializedValue); } @Override - public Long expire(final byte[] key, final int seconds) { + public Long expire(final byte[] key, final long seconds) { Jedis j = getShard(key); return j.expire(key, seconds); } @@ -176,7 +176,7 @@ public Long setnx(final byte[] key, final byte[] value) { } @Override - public String setex(final byte[] key, final int seconds, final byte[] value) { + public String setex(final byte[] key, final long seconds, final byte[] value) { Jedis j = getShard(key); return j.setex(key, seconds, value); } @@ -1070,7 +1070,7 @@ public Long xlen(byte[] key) { } @Override - public List xrange(byte[] key, byte[] start, byte[] end, long count) { + public List xrange(byte[] key, byte[] start, byte[] end, int count) { Jedis j = getShard(key); return j.xrange(key, start, end, count); } @@ -1124,14 +1124,15 @@ public Long xtrim(byte[] key, long maxLen, boolean approximateLength) { } @Override - public List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername) { + public List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, + byte[] consumername) { Jedis j = getShard(key); return j.xpending(key, groupname, start, end, count, consumername); } @Override - public List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, - int retries, boolean force, byte[][] ids) { + public List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, + long newIdleTime, int retries, boolean force, byte[]... ids) { Jedis j = getShard(key); return j.xclaim(key, groupname, consumername, minIdleTime, newIdleTime, retries, force, ids); } @@ -1142,18 +1143,36 @@ public StreamInfo xinfoStream(byte[] key) { return j.xinfoStream(key); } + @Override + public Object xinfoStreamBinary(byte[] key) { + Jedis j = getShard(key); + return j.xinfoStreamBinary(key); + } + @Override public List xinfoGroup(byte[] key) { Jedis j = getShard(key); return j.xinfoGroup(key); } + @Override + public List xinfoGroupBinary(byte[] key) { + Jedis j = getShard(key); + return j.xinfoGroupBinary(key); + } + @Override public List xinfoConsumers(byte[] key, byte[] group) { Jedis j = getShard(key); return j.xinfoConsumers(key, group); } + @Override + public List xinfoConsumersBinary(byte[] key, byte[] group) { + Jedis j = getShard(key); + return j.xinfoConsumersBinary(key, group); + } + public Object sendCommand(ProtocolCommand cmd, byte[]... args) { // default since no sample key provided in JedisCommands interface byte[] sampleKey = args.length > 0 ? args[0] : cmd.getRaw(); diff --git a/src/main/java/redis/clients/jedis/BuilderFactory.java b/src/main/java/redis/clients/jedis/BuilderFactory.java index 23cc7b8aac..de45c28f5a 100644 --- a/src/main/java/redis/clients/jedis/BuilderFactory.java +++ b/src/main/java/redis/clients/jedis/BuilderFactory.java @@ -13,6 +13,29 @@ import redis.clients.jedis.util.SafeEncoder; public final class BuilderFactory { + + public static final Builder OBJECT = new Builder() { + @Override + public Object build(Object data) { + return data; + } + @Override + public String toString() { + return "Object"; + } + }; + + public static final Builder> OBJECT_LIST = new Builder>() { + @Override + public List build(Object data) { + return (List) data; + } + @Override + public String toString() { + return "List"; + } + }; + public static final Builder DOUBLE = new Builder() { @Override public Double build(Object data) { @@ -875,23 +898,6 @@ public String toString() { } }; - public static final Builder OBJECT = new Builder() { - @Override - public Object build(Object data) { - return data; - } - @Override - public String toString() { - return "Object"; - } - }; - - - - private BuilderFactory() { - throw new InstantiationError( "Must not instantiate this class" ); - } - private static Map createMapFromDecodingFunctions( Iterator iterator, Map mappingFunctions) { Map resultMap = new HashMap<>(); @@ -916,4 +922,8 @@ private static Map createMapFromDecodingFunctions( Iterator(connectionHandler, maxAttempts) { @Override public String execute(Jedis connection) { @@ -294,7 +294,7 @@ public String execute(Jedis connection) { } @Override - public Long expire(final String key, final int seconds) { + public Long expire(final String key, final long seconds) { return new JedisClusterCommand(connectionHandler, maxAttempts) { @Override public Long execute(Jedis connection) { @@ -444,7 +444,7 @@ public Long execute(Jedis connection) { } @Override - public String setex(final String key, final int seconds, final String value) { + public String setex(final String key, final long seconds, final String value) { return new JedisClusterCommand(connectionHandler, maxAttempts) { @Override public String execute(Jedis connection) { diff --git a/src/main/java/redis/clients/jedis/PipelineBase.java b/src/main/java/redis/clients/jedis/PipelineBase.java index 3e4f69763f..d71598862f 100644 --- a/src/main/java/redis/clients/jedis/PipelineBase.java +++ b/src/main/java/redis/clients/jedis/PipelineBase.java @@ -136,13 +136,13 @@ public Response exists(final byte[] key) { } @Override - public Response expire(final String key, final int seconds) { + public Response expire(final String key, final long seconds) { getClient(key).expire(key, seconds); return getResponse(BuilderFactory.LONG); } @Override - public Response expire(final byte[] key, final int seconds) { + public Response expire(final byte[] key, final long seconds) { getClient(key).expire(key, seconds); return getResponse(BuilderFactory.LONG); } @@ -722,13 +722,13 @@ public Response setbit(final byte[] key, final long offset, final byte[ } @Override - public Response setex(final String key, final int seconds, final String value) { + public Response setex(final String key, final long seconds, final String value) { getClient(key).setex(key, seconds, value); return getResponse(BuilderFactory.STRING); } @Override - public Response setex(final byte[] key, final int seconds, final byte[] value) { + public Response setex(final byte[] key, final long seconds, final byte[] value) { getClient(key).setex(key, seconds, value); return getResponse(BuilderFactory.STRING); } @@ -1656,25 +1656,25 @@ public Response pttl(final byte[] key) { } @Override - public Response restore(final String key, final int ttl, final byte[] serializedValue) { + public Response restore(final String key, final long ttl, final byte[] serializedValue) { getClient(key).restore(key, ttl, serializedValue); return getResponse(BuilderFactory.STRING); } @Override - public Response restore(final byte[] key, final int ttl, final byte[] serializedValue) { + public Response restore(final byte[] key, final long ttl, final byte[] serializedValue) { getClient(key).restore(key, ttl, serializedValue); return getResponse(BuilderFactory.STRING); } @Override - public Response restoreReplace(final String key, final int ttl, final byte[] serializedValue) { + public Response restoreReplace(final String key, final long ttl, final byte[] serializedValue) { getClient(key).restoreReplace(key, ttl, serializedValue); return getResponse(BuilderFactory.STRING); } @Override - public Response restoreReplace(final byte[] key, final int ttl, final byte[] serializedValue) { + public Response restoreReplace(final byte[] key, final long ttl, final byte[] serializedValue) { getClient(key).restoreReplace(key, ttl, serializedValue); return getResponse(BuilderFactory.STRING); } @@ -2092,7 +2092,12 @@ public Response> xpending(byte[] key, byte[] groupname, getClient(key).xpending(key, groupname, start, end, count, consumername); return getResponse(BuilderFactory.STREAM_PENDING_ENTRY_LIST); } - + + @Override + public Response> xpendingBinary(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername) { + getClient(key).xpending(key, groupname, start, end, count, consumername); + return getResponse(BuilderFactory.OBJECT_LIST); + } @Override public Response xdel( String key, StreamEntryID... ids){ diff --git a/src/main/java/redis/clients/jedis/ShardedJedis.java b/src/main/java/redis/clients/jedis/ShardedJedis.java index a950c9ebe9..3a407cc36d 100644 --- a/src/main/java/redis/clients/jedis/ShardedJedis.java +++ b/src/main/java/redis/clients/jedis/ShardedJedis.java @@ -85,19 +85,19 @@ public byte[] dump(final String key) { } @Override - public String restore(final String key, final int ttl, final byte[] serializedValue) { + public String restore(final String key, final long ttl, final byte[] serializedValue) { Jedis j = getShard(key); return j.restore(key, ttl, serializedValue); } @Override - public String restoreReplace(final String key, final int ttl, final byte[] serializedValue) { + public String restoreReplace(final String key, final long ttl, final byte[] serializedValue) { Jedis j = getShard(key); return j.restoreReplace(key, ttl, serializedValue); } @Override - public Long expire(final String key, final int seconds) { + public Long expire(final String key, final long seconds) { Jedis j = getShard(key); return j.expire(key, seconds); } @@ -175,7 +175,7 @@ public Long setnx(final String key, final String value) { } @Override - public String setex(final String key, final int seconds, final String value) { + public String setex(final String key, final long seconds, final String value) { Jedis j = getShard(key); return j.setex(key, seconds, value); } diff --git a/src/main/java/redis/clients/jedis/commands/BinaryJedisClusterCommands.java b/src/main/java/redis/clients/jedis/commands/BinaryJedisClusterCommands.java index ab05382540..d155fee5e1 100644 --- a/src/main/java/redis/clients/jedis/commands/BinaryJedisClusterCommands.java +++ b/src/main/java/redis/clients/jedis/commands/BinaryJedisClusterCommands.java @@ -35,7 +35,15 @@ public interface BinaryJedisClusterCommands { byte[] dump(byte[] key); - String restore(byte[] key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(byte[], long, byte[])}. + */ + @Deprecated + default String restore(byte[] key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + String restore(byte[] key, long ttl, byte[] serializedValue); Long expire(byte[] key, int seconds); @@ -65,7 +73,15 @@ public interface BinaryJedisClusterCommands { Long setnx(byte[] key, byte[] value); - String setex(byte[] key, int seconds, byte[] value); + /** + * @deprecated Use {@link #setex(byte[], long, byte[])}. + */ + @Deprecated + default String setex(byte[] key, int seconds, byte[] value) { + return setex(key, (long) seconds, value); + } + + String setex(byte[] key, long seconds, byte[] value); String psetex(byte[] key, long milliseconds, byte[] value); @@ -253,13 +269,11 @@ public interface BinaryJedisClusterCommands { Set zrangeByLex(byte[] key, byte[] min, byte[] max); - Set zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, - int count); + Set zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count); Set zrevrangeByLex(byte[] key, byte[] max, byte[] min); - Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, - int count); + Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count); Long zremrangeByLex(byte[] key, byte[] min, byte[] max); @@ -297,17 +311,16 @@ Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, List geopos(byte[] key, byte[]... members); - List georadius(byte[] key, double longitude, double latitude, double radius, - GeoUnit unit); + List georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit); - List georadiusReadonly(byte[] key, double longitude, double latitude, double radius, - GeoUnit unit); + List georadiusReadonly(byte[] key, double longitude, double latitude, + double radius, GeoUnit unit); List georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusReadonly(byte[] key, double longitude, double latitude, double radius, - GeoUnit unit, GeoRadiusParam param); + List georadiusReadonly(byte[] key, double longitude, double latitude, + double radius, GeoUnit unit, GeoRadiusParam param); List georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit); @@ -316,8 +329,8 @@ List georadiusReadonly(byte[] key, double longitude, double l List georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit, - GeoRadiusParam param); + List georadiusByMemberReadonly(byte[] key, byte[] member, double radius, + GeoUnit unit, GeoRadiusParam param); ScanResult> hscan(byte[] key, byte[] cursor); @@ -352,9 +365,15 @@ List georadiusByMemberReadonly(byte[] key, byte[] member, dou byte[] xadd(final byte[] key, final byte[] id, final Map hash, long maxLen, boolean approximateLength); Long xlen(final byte[] key); - + + /** + * @deprecated Use {@link #xrange(byte[], byte[], byte[], int)}. + */ + @Deprecated List xrange(final byte[] key, final byte[] start, final byte[] end, final long count); + List xrange(final byte[] key, final byte[] start, final byte[] end, final int count); + List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count); Long xack(final byte[] key, final byte[] group, final byte[]... ids); @@ -371,7 +390,7 @@ List georadiusByMemberReadonly(byte[] key, byte[] member, dou Long xtrim(byte[] key, long maxLen, boolean approximateLength); - List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); + List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[][] ids); diff --git a/src/main/java/redis/clients/jedis/commands/BinaryJedisCommands.java b/src/main/java/redis/clients/jedis/commands/BinaryJedisCommands.java index 0d48304400..632a78cd10 100644 --- a/src/main/java/redis/clients/jedis/commands/BinaryJedisCommands.java +++ b/src/main/java/redis/clients/jedis/commands/BinaryJedisCommands.java @@ -41,11 +41,35 @@ public interface BinaryJedisCommands { byte[] dump(byte[] key); - String restore(byte[] key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(byte[], long, byte[])}. + */ + @Deprecated + default String restore(byte[] key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + String restore(byte[] key, long ttl, byte[] serializedValue); + + /** + * @deprecated Use {@link #restoreReplace(byte[], long, byte[])}. + */ + @Deprecated + default String restoreReplace(byte[] key, int ttl, byte[] serializedValue) { + return restoreReplace(key, (long) ttl, serializedValue); + } - String restoreReplace(byte[] key, int ttl, byte[] serializedValue); + String restoreReplace(byte[] key, long ttl, byte[] serializedValue); - Long expire(byte[] key, int seconds); + /** + * @deprecated Use {@link #expire(byte[], long)}. + */ + @Deprecated + default Long expire(byte[] key, int seconds) { + return expire(key, (long) seconds); + } + + Long expire(byte[] key, long seconds); Long pexpire(byte[] key, long milliseconds); @@ -73,7 +97,15 @@ public interface BinaryJedisCommands { Long setnx(byte[] key, byte[] value); - String setex(byte[] key, int seconds, byte[] value); + /** + * @deprecated Use {@link #setex(byte[], long, byte[])}. + */ + @Deprecated + default String setex(byte[] key, int seconds, byte[] value) { + return setex(key, (long) seconds, value); + } + + String setex(byte[] key, long seconds, byte[] value); String psetex(byte[] key, long milliseconds, byte[] value); @@ -261,13 +293,11 @@ public interface BinaryJedisCommands { Set zrangeByLex(byte[] key, byte[] min, byte[] max); - Set zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, - int count); + Set zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count); Set zrevrangeByLex(byte[] key, byte[] max, byte[] min); - Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, - int count); + Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count); Long zremrangeByLex(byte[] key, byte[] min, byte[] max); @@ -310,14 +340,14 @@ Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, List georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit); - List georadiusReadonly(byte[] key, double longitude, double latitude, double radius, - GeoUnit unit); + List georadiusReadonly(byte[] key, double longitude, double latitude, + double radius, GeoUnit unit); List georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusReadonly(byte[] key, double longitude, double latitude, double radius, - GeoUnit unit, GeoRadiusParam param); + List georadiusReadonly(byte[] key, double longitude, double latitude, + double radius, GeoUnit unit, GeoRadiusParam param); List georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit); @@ -326,8 +356,8 @@ List georadiusReadonly(byte[] key, double longitude, double l List georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit, - GeoRadiusParam param); + List georadiusByMemberReadonly(byte[] key, byte[] member, double radius, + GeoUnit unit, GeoRadiusParam param); ScanResult> hscan(byte[] key, byte[] cursor); @@ -363,8 +393,16 @@ List georadiusByMemberReadonly(byte[] key, byte[] member, dou byte[] xadd(final byte[] key, final byte[] id, final Map hash, long maxLen, boolean approximateLength); Long xlen(final byte[] key); - - List xrange(final byte[] key, final byte[] start, final byte[] end, final long count); + + /** + * @deprecated Use {@link #xrange(byte[], byte[], byte[], int)}. + */ + @Deprecated + default List xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { + return xrange(key, start, end, (int) Math.max(count, (long) Integer.MAX_VALUE)); + } + + List xrange(final byte[] key, final byte[] start, final byte[] end, final int count); List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count); @@ -382,13 +420,31 @@ List georadiusByMemberReadonly(byte[] key, byte[] member, dou Long xtrim(byte[] key, long maxLen, boolean approximateLength); - List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); + List xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); - List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[][] ids); + List xclaim(byte[] key, byte[] groupname, byte[] consumername, long minIdleTime, long newIdleTime, int retries, boolean force, byte[]... ids); - StreamInfo xinfoStream (byte[] key); + /** + * @deprecated Use {@link #xinfoStreamBinary(byte[])}. + */ + @Deprecated + StreamInfo xinfoStream(byte[] key); - List xinfoGroup (byte[] key); + Object xinfoStreamBinary(byte[] key); + + /** + * @deprecated Use {@link #xinfoGroupBinary(byte[])}. + */ + @Deprecated + List xinfoGroup(byte[] key); + + List xinfoGroupBinary(byte[] key); + + /** + * @deprecated Use {@link #xinfoConsumersBinary(byte[], byte[])}. + */ + @Deprecated + List xinfoConsumers(byte[] key, byte[] group); - List xinfoConsumers (byte[] key, byte[] group); + List xinfoConsumersBinary(byte[] key, byte[] group); } diff --git a/src/main/java/redis/clients/jedis/commands/BinaryRedisPipeline.java b/src/main/java/redis/clients/jedis/commands/BinaryRedisPipeline.java index 1e0d7e45b2..2ce3e2f938 100644 --- a/src/main/java/redis/clients/jedis/commands/BinaryRedisPipeline.java +++ b/src/main/java/redis/clients/jedis/commands/BinaryRedisPipeline.java @@ -38,7 +38,15 @@ public interface BinaryRedisPipeline { Response exists(byte[] key); - Response expire(byte[] key, int seconds); + /** + * @deprecated Use {@link #expire(byte[], long)}. + */ + @Deprecated + default Response expire(byte[] key, int seconds) { + return expire(key, (long) seconds); + } + + Response expire(byte[] key, long seconds); Response pexpire(byte[] key, long milliseconds); @@ -136,7 +144,15 @@ public interface BinaryRedisPipeline { Response setrange(byte[] key, long offset, byte[] value); - Response setex(byte[] key, int seconds, byte[] value); + /** + * @deprecated Use {@link #setex(byte[], long, byte[])}. + */ + @Deprecated + default Response setex(byte[] key, int seconds, byte[] value) { + return setex(key, (long) seconds, value); + } + + Response setex(byte[] key, long seconds, byte[] value); Response setnx(byte[] key, byte[] value); @@ -204,11 +220,9 @@ public interface BinaryRedisPipeline { Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max); - Response> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, - int count); + Response> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, int count); - Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, - int count); + Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, int count); Response> zrevrangeByScore(byte[] key, double max, double min); @@ -222,11 +236,9 @@ Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min); - Response> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, - int count); + Response> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count); - Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, - int count); + Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count); Response> zrangeWithScores(byte[] key, long start, long stop); @@ -262,13 +274,11 @@ Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] m Response> zrangeByLex(byte[] key, byte[] min, byte[] max); - Response> zrangeByLex(byte[] key, byte[] min, byte[] max, - int offset, int count); + Response> zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count); Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min); - Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min, - int offset, int count); + Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count); Response zremrangeByLex(byte[] key, byte[] min, byte[] max); @@ -282,9 +292,25 @@ Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min, Response dump(byte[] key); - Response restore(byte[] key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(byte[], long, byte[])}. + */ + @Deprecated + default Response restore(byte[] key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + Response restore(byte[] key, long ttl, byte[] serializedValue); - Response restoreReplace(byte[] key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restoreReplace(byte[], long, byte[])}. + */ + @Deprecated + default Response restoreReplace(byte[] key, int ttl, byte[] serializedValue) { + return restoreReplace(key, (long) ttl, serializedValue); + } + + Response restoreReplace(byte[] key, long ttl, byte[] serializedValue); Response migrate(String host, int port, byte[] key, int destinationDB, int timeout); @@ -317,14 +343,14 @@ Response> georadiusReadonly(byte[] key, double longitude Response> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit); - Response> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, - GeoUnit unit); + Response> georadiusByMemberReadonly(byte[] key, byte[] member, + double radius, GeoUnit unit); Response> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param); - Response> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, - GeoUnit unit, GeoRadiusParam param); + Response> georadiusByMemberReadonly(byte[] key, byte[] member, + double radius, GeoUnit unit, GeoRadiusParam param); Response> bitfield(byte[] key, byte[]... elements); @@ -352,8 +378,14 @@ Response> georadiusByMemberReadonly(byte[] key, byte[] m Response xgroupDelConsumer(byte[] key, byte[] groupname, byte[] consumername); + /** + * @deprecated Use {@link #xpendingBinary(byte[], byte[], byte[], byte[], int, byte[])}. + */ + @Deprecated Response> xpending(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); - + + Response> xpendingBinary(byte[] key, byte[] groupname, byte[] start, byte[] end, int count, byte[] consumername); + Response xdel(byte[] key, byte[]... ids); Response xtrim(byte[] key, long maxLen, boolean approximateLength); diff --git a/src/main/java/redis/clients/jedis/commands/Commands.java b/src/main/java/redis/clients/jedis/commands/Commands.java index 298808097a..19b3338d92 100644 --- a/src/main/java/redis/clients/jedis/commands/Commands.java +++ b/src/main/java/redis/clients/jedis/commands/Commands.java @@ -42,7 +42,15 @@ public interface Commands { void renamenx(String oldkey, String newkey); - void expire(String key, int seconds); + /** + * @deprecated Use {@link #expire(java.lang.String, long)}. + */ + @Deprecated + default void expire(String key, int seconds) { + expire(key, (long) seconds); + } + + void expire(String key, long seconds); void expireAt(String key, long unixTime); @@ -70,7 +78,15 @@ public interface Commands { void setnx(String key, String value); - void setex(String key, int seconds, String value); + /** + * @deprecated Use {@link #setex(java.lang.String, long, java.lang.String)}. + */ + @Deprecated + default void setex(String key, int seconds, String value) { + setex(key, (long) seconds, value); + } + + void setex(String key, long seconds, String value); void mset(String... keysvalues); @@ -246,39 +262,33 @@ public interface Commands { void zrangeByScore(String key, String min, String max); - void zrangeByScore(String key, double min, double max, int offset, - int count); + void zrangeByScore(String key, double min, double max, int offset, int count); void zrangeByScore(String key, String min, String max, int offset, int count); void zrangeByScoreWithScores(String key, double min, double max); - void zrangeByScoreWithScores(String key, double min, double max, - int offset, int count); + void zrangeByScoreWithScores(String key, double min, double max, int offset, int count); void zrangeByScoreWithScores(String key, String min, String max); - void zrangeByScoreWithScores(String key, String min, String max, - int offset, int count); + void zrangeByScoreWithScores(String key, String min, String max, int offset, int count); void zrevrangeByScore(String key, double max, double min); void zrevrangeByScore(String key, String max, String min); - void zrevrangeByScore(String key, double max, double min, int offset, - int count); + void zrevrangeByScore(String key, double max, double min, int offset, int count); void zrevrangeByScore(String key, String max, String min, int offset, int count); void zrevrangeByScoreWithScores(String key, double max, double min); - void zrevrangeByScoreWithScores(String key, double max, double min, - int offset, int count); + void zrevrangeByScoreWithScores(String key, double max, double min, int offset, int count); void zrevrangeByScoreWithScores(String key, String max, String min); - void zrevrangeByScoreWithScores(String key, String max, String min, - int offset, int count); + void zrevrangeByScoreWithScores(String key, String max, String min, int offset, int count); void zremrangeByRank(String key, long start, long stop); @@ -344,9 +354,25 @@ void zrevrangeByScoreWithScores(String key, String max, String min, void dump(String key); - void restore(String key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(java.lang.String, long, byte[])}. + */ + @Deprecated + default void restore(String key, int ttl, byte[] serializedValue) { + restore(key, (long) ttl, serializedValue); + } - void restoreReplace(String key, int ttl, byte[] serializedValue); + void restore(String key, long ttl, byte[] serializedValue); + + /** + * @deprecated Use {@link #restoreReplace(java.lang.String, long, byte[])}. + */ + @Deprecated + default void restoreReplace(String key, int ttl, byte[] serializedValue) { + restoreReplace(key, (long) ttl, serializedValue); + } + + void restoreReplace(String key, long ttl, byte[] serializedValue); void scan(String cursor, ScanParams params); @@ -422,9 +448,12 @@ void zrevrangeByScoreWithScores(String key, String max, String min, void xpending(String key, String groupname, StreamEntryID start, StreamEntryID end, int count, String consumername); - void xclaim(String key, String group, String consumername, long minIdleTime, long newIdleTime, int retries, - boolean force, StreamEntryID... ids); + void xclaim(String key, String group, String consumername, long minIdleTime, long newIdleTime, + int retries, boolean force, StreamEntryID... ids); + void xinfoStream (String key); + void xinfoGroup (String key); + void xinfoConsumers (String key, String group); } diff --git a/src/main/java/redis/clients/jedis/commands/JedisClusterCommands.java b/src/main/java/redis/clients/jedis/commands/JedisClusterCommands.java index 8fb53f9c24..4d8b83edea 100644 --- a/src/main/java/redis/clients/jedis/commands/JedisClusterCommands.java +++ b/src/main/java/redis/clients/jedis/commands/JedisClusterCommands.java @@ -37,9 +37,25 @@ public interface JedisClusterCommands { byte[] dump(String key); - String restore(String key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(java.lang.String, long, byte[])}. + */ + @Deprecated + default String restore(String key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + String restore(String key, long ttl, byte[] serializedValue); + + /** + * @deprecated Use {@link #expire(java.lang.String, long)}. + */ + @Deprecated + default Long expire(String key, int seconds) { + return expire(key, (long) seconds); + } - Long expire(String key, int seconds); + Long expire(String key, long seconds); Long pexpire(String key, long milliseconds); @@ -67,7 +83,15 @@ public interface JedisClusterCommands { Long setnx(String key, String value); - String setex(String key, int seconds, String value); + /** + * @deprecated Use {@link #setex(java.lang.String, long, java.lang.String)}. + */ + @Deprecated + default String setex(String key, int seconds, String value) { + return setex(key, (long) seconds, value); + } + + String setex(String key, long seconds, String value); String psetex(String key, long milliseconds, String value); @@ -255,13 +279,11 @@ public interface JedisClusterCommands { Set zrangeByLex(String key, String min, String max); - Set zrangeByLex(String key, String min, String max, int offset, - int count); + Set zrangeByLex(String key, String min, String max, int offset, int count); Set zrevrangeByLex(String key, String max, String min); - Set zrevrangeByLex(String key, String max, String min, - int offset, int count); + Set zrevrangeByLex(String key, String max, String min, int offset, int count); Long zremrangeByLex(String key, String min, String max); @@ -312,14 +334,14 @@ Set zrevrangeByLex(String key, String max, String min, List georadius(String key, double longitude, double latitude, double radius, GeoUnit unit); - List georadiusReadonly(String key, double longitude, double latitude, double radius, - GeoUnit unit); + List georadiusReadonly(String key, double longitude, double latitude, + double radius, GeoUnit unit); List georadius(String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusReadonly(String key, double longitude, double latitude, double radius, - GeoUnit unit, GeoRadiusParam param); + List georadiusReadonly(String key, double longitude, double latitude, + double radius, GeoUnit unit, GeoRadiusParam param); List georadiusByMember(String key, String member, double radius, GeoUnit unit); @@ -328,8 +350,8 @@ List georadiusReadonly(String key, double longitude, double l List georadiusByMember(String key, String member, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusByMemberReadonly(String key, String member, double radius, GeoUnit unit, - GeoRadiusParam param); + List georadiusByMemberReadonly(String key, String member, double radius, + GeoUnit unit, GeoRadiusParam param); /** * Executes BITFIELD Redis command diff --git a/src/main/java/redis/clients/jedis/commands/JedisCommands.java b/src/main/java/redis/clients/jedis/commands/JedisCommands.java index 42e687097b..cb50b08ae5 100644 --- a/src/main/java/redis/clients/jedis/commands/JedisCommands.java +++ b/src/main/java/redis/clients/jedis/commands/JedisCommands.java @@ -45,11 +45,36 @@ public interface JedisCommands { byte[] dump(String key); - String restore(String key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(java.lang.String, long, byte[])}. + */ + @Deprecated + default String restore(String key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + String restore(String key, long ttl, byte[] serializedValue); - String restoreReplace(String key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restoreReplace(java.lang.String, long, byte[])}. + */ + @Deprecated + default String restoreReplace(String key, int ttl, byte[] serializedValue) { + return restoreReplace(key, (long) ttl, serializedValue); + } - Long expire(String key, int seconds); + String restoreReplace(String key, long ttl, byte[] serializedValue); + + + /** + * @deprecated Use {@link #expire(java.lang.String, long)}. + */ + @Deprecated + default Long expire(String key, int seconds) { + return expire(key, (long) seconds); + } + + Long expire(String key, long seconds); Long pexpire(String key, long milliseconds); @@ -77,7 +102,15 @@ public interface JedisCommands { Long setnx(String key, String value); - String setex(String key, int seconds, String value); + /** + * @deprecated Use {@link #setex(java.lang.String, long, java.lang.String)}. + */ + @Deprecated + default String setex(String key, int seconds, String value) { + return setex(key, (long) seconds, value); + } + + String setex(String key, long seconds, String value); String psetex(String key, long milliseconds, String value); @@ -265,13 +298,11 @@ public interface JedisCommands { Set zrangeByLex(String key, String min, String max); - Set zrangeByLex(String key, String min, String max, int offset, - int count); + Set zrangeByLex(String key, String min, String max, int offset, int count); Set zrevrangeByLex(String key, String max, String min); - Set zrevrangeByLex(String key, String max, String min, - int offset, int count); + Set zrevrangeByLex(String key, String max, String min, int offset, int count); Long zremrangeByLex(String key, String min, String max); @@ -303,8 +334,7 @@ Set zrevrangeByLex(String key, String max, String min, ScanResult> hscan(String key, String cursor); - ScanResult> hscan(String key, String cursor, - ScanParams params); + ScanResult> hscan(String key, String cursor, ScanParams params); ScanResult sscan(String key, String cursor); @@ -335,14 +365,14 @@ ScanResult> hscan(String key, String cursor, List georadius(String key, double longitude, double latitude, double radius, GeoUnit unit); - List georadiusReadonly(String key, double longitude, double latitude, double radius, - GeoUnit unit); + List georadiusReadonly(String key, double longitude, double latitude, + double radius, GeoUnit unit); List georadius(String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusReadonly(String key, double longitude, double latitude, double radius, - GeoUnit unit, GeoRadiusParam param); + List georadiusReadonly(String key, double longitude, double latitude, + double radius, GeoUnit unit, GeoRadiusParam param); List georadiusByMember(String key, String member, double radius, GeoUnit unit); @@ -351,8 +381,8 @@ List georadiusReadonly(String key, double longitude, double l List georadiusByMember(String key, String member, double radius, GeoUnit unit, GeoRadiusParam param); - List georadiusByMemberReadonly(String key, String member, double radius, GeoUnit unit, - GeoRadiusParam param); + List georadiusByMemberReadonly(String key, String member, double radius, + GeoUnit unit, GeoRadiusParam param); /** * Executes BITFIELD Redis command diff --git a/src/main/java/redis/clients/jedis/commands/RedisPipeline.java b/src/main/java/redis/clients/jedis/commands/RedisPipeline.java index 8106a2f9a5..7fbfa93047 100644 --- a/src/main/java/redis/clients/jedis/commands/RedisPipeline.java +++ b/src/main/java/redis/clients/jedis/commands/RedisPipeline.java @@ -40,7 +40,15 @@ public interface RedisPipeline { Response exists(String key); - Response expire(String key, int seconds); + /** + * @deprecated Use {@link #expire(java.lang.String, long)}. + */ + @Deprecated + default Response expire(String key, int seconds) { + return expire(key, (long) seconds); + } + + Response expire(String key, long seconds); Response pexpire(String key, long milliseconds); @@ -140,7 +148,15 @@ public interface RedisPipeline { Response setbit(String key, long offset, boolean value); - Response setex(String key, int seconds, String value); + /** + * @deprecated Use {@link #setex(java.lang.String, long, java.lang.String)}. + */ + @Deprecated + default Response setex(String key, int seconds, String value) { + return setex(key, (long) seconds, value); + } + + Response setex(String key, long seconds, String value); Response setnx(String key, String value); @@ -202,8 +218,7 @@ public interface RedisPipeline { Response> zrangeByScoreWithScores(String key, double min, double max); - Response> zrangeByScoreWithScores(String key, double min, double max, int offset, - int count); + Response> zrangeByScoreWithScores(String key, double min, double max, int offset, int count); Response> zrevrangeByScore(String key, double max, double min); @@ -217,11 +232,9 @@ Response> zrangeByScoreWithScores(String key, double min, double max, Response> zrevrangeByScoreWithScores(String key, String max, String min); - Response> zrevrangeByScoreWithScores(String key, double max, double min, int offset, - int count); + Response> zrevrangeByScoreWithScores(String key, double max, double min, int offset, int count); - Response> zrevrangeByScoreWithScores(String key, String max, String min, int offset, - int count); + Response> zrevrangeByScoreWithScores(String key, String max, String min, int offset, int count); Response> zrangeWithScores(String key, long start, long stop); @@ -257,13 +270,11 @@ Response> zrevrangeByScoreWithScores(String key, String max, String m Response> zrangeByLex(String key, String min, String max); - Response> zrangeByLex(String key, String min, String max, - int offset, int count); + Response> zrangeByLex(String key, String min, String max, int offset, int count); Response> zrevrangeByLex(String key, String max, String min); - Response> zrevrangeByLex(String key, String max, String min, - int offset, int count); + Response> zrevrangeByLex(String key, String max, String min, int offset, int count); Response zremrangeByLex(String key, String min, String max); @@ -283,9 +294,25 @@ Response> zrevrangeByLex(String key, String max, String min, Response dump(String key); - Response restore(String key, int ttl, byte[] serializedValue); + /** + * @deprecated Use {@link #restore(java.lang.String, long, byte[])}. + */ + @Deprecated + default Response restore(String key, int ttl, byte[] serializedValue) { + return restore(key, (long) ttl, serializedValue); + } + + Response restore(String key, long ttl, byte[] serializedValue); + + /** + * @deprecated Use {@link #restoreReplace(java.lang.String, long, byte[])}. + */ + @Deprecated + default Response restoreReplace(String key, int ttl, byte[] serializedValue) { + return restoreReplace(key, (long) ttl, serializedValue); + } - Response restoreReplace(String key, int ttl, byte[] serializedValue); + Response restoreReplace(String key, long ttl, byte[] serializedValue); Response migrate(String host, int port, String key, int destinationDB, int timeout); @@ -318,14 +345,14 @@ Response> georadiusReadonly(String key, double longitude Response> georadiusByMember(String key, String member, double radius, GeoUnit unit); - Response> georadiusByMemberReadonly(String key, String member, double radius, - GeoUnit unit); + Response> georadiusByMemberReadonly(String key, String member, + double radius, GeoUnit unit); Response> georadiusByMember(String key, String member, double radius, GeoUnit unit, GeoRadiusParam param); - Response> georadiusByMemberReadonly(String key, String member, double radius, - GeoUnit unit, GeoRadiusParam param); + Response> georadiusByMemberReadonly(String key, String member, + double radius, GeoUnit unit, GeoRadiusParam param); Response xadd(String key, StreamEntryID id, Map hash); @@ -347,7 +374,8 @@ Response> georadiusByMemberReadonly(String key, String m Response xgroupDelConsumer( String key, String groupname, String consumername); - Response> xpending(String key, String groupname, StreamEntryID start, StreamEntryID end, int count, String consumername); + Response> xpending(String key, String groupname, + StreamEntryID start, StreamEntryID end, int count, String consumername); Response xdel( String key, StreamEntryID... ids); @@ -366,8 +394,7 @@ Response> xclaim( String key, String group, String consumernam Response> zrangeByScoreWithScores(String key, String min, String max); - Response> zrangeByScoreWithScores(String key, String min, String max, int offset, - int count); + Response> zrangeByScoreWithScores(String key, String min, String max, int offset, int count); Response objectRefcount(String key);