From f65161bfa3b68e28220c681902ba9e94a049f67b Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Thu, 6 Mar 2014 17:17:30 +0100 Subject: [PATCH 1/2] DATAREDIS-275 - Rename RedisServerCommands.bgWriteAof to bgReWriteAof. Prepare issue branch. --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f09fb8eb53..21bd588fbb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ jredisVersion=06052013 jedisVersion=2.4.1 springVersion=3.2.8.RELEASE log4jVersion=1.2.17 -version=1.3.0.BUILD-SNAPSHOT +version=1.3.0.DATAREDIS-275-SNAPSHOT srpVersion=0.7 jacksonVersion=1.8.8 fasterXmlJacksonVersion=2.2.0 From 905a3b3020f58419b76dacd6d6230a5e4b292454 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Thu, 6 Mar 2014 17:36:41 +0100 Subject: [PATCH 2/2] DATAREDIS-275 - Rename RedisServerCommands.bgWriteAof to bgReWriteAof. Renamed method and placed @Deprecated delegate-Methods in order to avoid breaking clients. Original pull request: #44. --- .../connection/DefaultStringRedisConnection.java | 12 +++++++++++- .../redis/connection/RedisServerCommands.java | 11 +++++++++++ .../redis/connection/jedis/JedisConnection.java | 16 ++++++++++++---- .../connection/jredis/JredisConnection.java | 10 +++++++++- .../connection/lettuce/LettuceConnection.java | 13 ++++++++++--- .../data/redis/connection/srp/SrpConnection.java | 11 ++++++++++- 6 files changed, 63 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java index 1b9bf44bc4..671e2ee87d 100644 --- a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java @@ -42,6 +42,7 @@ * @author Costin Leau * @author Jennifer Hickey * @author Christoph Strobl + * @author Thomas Darimont */ public class DefaultStringRedisConnection implements StringRedisConnection { @@ -135,8 +136,17 @@ public void bgSave() { delegate.bgSave(); } + @Override + public void bgReWriteAof() { + delegate.bgReWriteAof(); + } + + /** + * @deprecated As of 1.3, use #bgReWriteAof + */ + @Deprecated public void bgWriteAof() { - delegate.bgWriteAof(); + bgReWriteAof(); } public List bLPop(int timeout, byte[]... keys) { diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java index 1589e87a13..4d4eaf96f1 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java @@ -23,6 +23,7 @@ * * @author Costin Leau * @author Christoph Strobl + * @author Thomas Darimont */ public interface RedisServerCommands { @@ -30,9 +31,19 @@ public interface RedisServerCommands { * Start an {@literal Append Only File} rewrite process on server. * * @see http://redis.io/commands/bgrewriteaof + * @deprecated As of 1.3, use #bgReWriteAof */ + @Deprecated void bgWriteAof(); + /** + * Start an {@literal Append Only File} rewrite process on server. + * + * @see http://redis.io/commands/bgrewriteaof + * @since 1.3 + */ + void bgReWriteAof(); + /** * Start background saving of db on server. * diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java index edcad95975..e3a9e07f1a 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java @@ -42,7 +42,6 @@ import org.springframework.data.redis.connection.convert.Converters; import org.springframework.data.redis.connection.convert.TransactionResultConverter; import org.springframework.util.Assert; -import org.springframework.util.NumberUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.ReflectionUtils; @@ -466,7 +465,8 @@ public void bgSave() { } } - public void bgWriteAof() { + @Override + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new JedisStatusResult(pipeline.bgrewriteaof())); @@ -482,6 +482,14 @@ public void bgWriteAof() { } } + /** + * @deprecated As of 1.3, use #bgReWriteAof + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) { @@ -2722,8 +2730,8 @@ public Long time() { List serverTimeInformation = this.jedis.time(); Assert.notEmpty(serverTimeInformation, "Received invalid result from server. Expected 2 items in collection."); - Assert.isTrue(serverTimeInformation.size() == 2, "Received invalid nr of arguments from redis server. Expected 2 received " - + serverTimeInformation.size()); + Assert.isTrue(serverTimeInformation.size() == 2, + "Received invalid nr of arguments from redis server. Expected 2 received " + serverTimeInformation.size()); return Converters.toTimeMillis(serverTimeInformation.get(0), serverTimeInformation.get(1)); } diff --git a/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java index 3d24f1f2b5..89dce844b4 100644 --- a/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java @@ -231,7 +231,7 @@ public void bgSave() { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { jredis.bgrewriteaof(); } catch (Exception ex) { @@ -239,6 +239,14 @@ public void bgWriteAof() { } } + /** + * @deprecated As of 1.3, use #bgReWriteAof + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { jredis.save(); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java index a363f7675e..a8bd8f5038 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java @@ -46,7 +46,6 @@ import org.springframework.data.redis.connection.convert.Converters; import org.springframework.data.redis.connection.convert.TransactionResultConverter; import org.springframework.util.Assert; -import org.springframework.util.NumberUtils; import org.springframework.util.ObjectUtils; import com.lambdaworks.redis.RedisAsyncConnection; @@ -480,7 +479,7 @@ public void bgSave() { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new LettuceStatusResult(getAsyncConnection().bgrewriteaof())); @@ -496,6 +495,14 @@ public void bgWriteAof() { } } + /** + * @deprecated As of 1.3, use #bgReWriteAof + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) { @@ -2776,7 +2783,7 @@ public Long time() { * support the time command natively. * see https://github.com/wg/lettuce/issues/19 */ - List result = (List)eval("return redis.call('TIME')".getBytes(),ReturnType.MULTI,0); + List result = (List) eval("return redis.call('TIME')".getBytes(), ReturnType.MULTI, 0); Assert.notEmpty(result, "Received invalid result from server. Expected 2 items in collection."); Assert.isTrue(result.size() == 2, "Received invalid nr of arguments from redis server. Expected 2 received " diff --git a/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java index 5594c0ccd4..92e813c88a 100644 --- a/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java @@ -60,6 +60,7 @@ * @author Costin Leau * @author Jennifer Hickey * @author Christoph Strobl + * @author Thomas Darimont */ public class SrpConnection implements RedisConnection { @@ -363,7 +364,7 @@ public void bgSave() { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new SrpStatusResult(pipeline.bgrewriteaof())); @@ -375,6 +376,14 @@ public void bgWriteAof() { } } + /** + * @deprecated As of 1.3, use #bgReWriteAof + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) {