Skip to content

DATAREDIS-275 - Rename RedisServerCommands.bgWriteAof to bgReWriteAof. #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
* @author Costin Leau
* @author Jennifer Hickey
* @author Christoph Strobl
* @author Thomas Darimont
*/
public class DefaultStringRedisConnection implements StringRedisConnection {

Expand Down Expand Up @@ -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<byte[]> bLPop(int timeout, byte[]... keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,27 @@
*
* @author Costin Leau
* @author Christoph Strobl
* @author Thomas Darimont
*/
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -466,7 +465,8 @@ public void bgSave() {
}
}

public void bgWriteAof() {
@Override
public void bgReWriteAof() {
try {
if (isPipelined()) {
pipeline(new JedisStatusResult(pipeline.bgrewriteaof()));
Expand All @@ -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()) {
Expand Down Expand Up @@ -2722,8 +2730,8 @@ public Long time() {
List<String> 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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,22 @@ public void bgSave() {
}
}

public void bgWriteAof() {
public void bgReWriteAof() {
try {
jredis.bgrewriteaof();
} catch (Exception ex) {
throw convertJredisAccessException(ex);
}
}

/**
* @deprecated As of 1.3, use #bgReWriteAof
*/
@Deprecated
public void bgWriteAof() {
bgReWriteAof();
}

public void save() {
try {
jredis.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -480,7 +479,7 @@ public void bgSave() {
}
}

public void bgWriteAof() {
public void bgReWriteAof() {
try {
if (isPipelined()) {
pipeline(new LettuceStatusResult(getAsyncConnection().bgrewriteaof()));
Expand All @@ -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()) {
Expand Down Expand Up @@ -2776,7 +2783,7 @@ public Long time() {
* support the time command natively.
* see https://github.com/wg/lettuce/issues/19
*/
List<byte[]> result = (List<byte[]>)eval("return redis.call('TIME')".getBytes(),ReturnType.MULTI,0);
List<byte[]> result = (List<byte[]>) 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 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* @author Costin Leau
* @author Jennifer Hickey
* @author Christoph Strobl
* @author Thomas Darimont
*/
public class SrpConnection implements RedisConnection {

Expand Down Expand Up @@ -363,7 +364,7 @@ public void bgSave() {
}
}

public void bgWriteAof() {
public void bgReWriteAof() {
try {
if (isPipelined()) {
pipeline(new SrpStatusResult(pipeline.bgrewriteaof()));
Expand All @@ -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()) {
Expand Down