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 1b9bf44bc..fdb338ce3 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 @@ import org.springframework.util.Assert; * @author Costin Leau * @author Jennifer Hickey * @author Christoph Strobl + * @author Thomas Darimont */ public class DefaultStringRedisConnection implements StringRedisConnection { @@ -135,8 +136,17 @@ public class DefaultStringRedisConnection implements StringRedisConnection { delegate.bgSave(); } + @Override + public void bgReWriteAof() { + delegate.bgReWriteAof(); + } + + /** + * @deprecated As of 1.3, use {@link #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 1589e87a1..b21cc0d3e 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 @@ import java.util.Properties; * * @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 {@link #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 edcad9597..e6ad85f06 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.Subscription; 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 class JedisConnection implements RedisConnection { } } - public void bgWriteAof() { + @Override + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new JedisStatusResult(pipeline.bgrewriteaof())); @@ -482,6 +482,14 @@ public class JedisConnection implements RedisConnection { } } + /** + * @deprecated As of 1.3, use {@link #bgReWriteAof}. + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) { @@ -2722,8 +2730,8 @@ public class JedisConnection implements RedisConnection { 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 3d24f1f2b..85c4e9a42 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 class JredisConnection implements RedisConnection { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { jredis.bgrewriteaof(); } catch (Exception ex) { @@ -239,6 +239,14 @@ public class JredisConnection implements RedisConnection { } } + /** + * @deprecated As of 1.3, use {@link #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 a363f7675..7f6680cb3 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.Subscription; 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 class LettuceConnection implements RedisConnection { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new LettuceStatusResult(getAsyncConnection().bgrewriteaof())); @@ -496,6 +495,14 @@ public class LettuceConnection implements RedisConnection { } } + /** + * @deprecated As of 1.3, use {@link #bgReWriteAof}. + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) { @@ -2776,7 +2783,7 @@ public class LettuceConnection implements RedisConnection { * 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 5594c0ccd..2aecab82d 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 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Costin Leau * @author Jennifer Hickey * @author Christoph Strobl + * @author Thomas Darimont */ public class SrpConnection implements RedisConnection { @@ -363,7 +364,7 @@ public class SrpConnection implements RedisConnection { } } - public void bgWriteAof() { + public void bgReWriteAof() { try { if (isPipelined()) { pipeline(new SrpStatusResult(pipeline.bgrewriteaof())); @@ -375,6 +376,14 @@ public class SrpConnection implements RedisConnection { } } + /** + * @deprecated As of 1.3, use {@link #bgReWriteAof}. + */ + @Deprecated + public void bgWriteAof() { + bgReWriteAof(); + } + public void save() { try { if (isPipelined()) {