add bgrewriteaof

This commit is contained in:
Jonathan Leibiusky
2010-12-20 10:36:43 -03:00
parent ff0b43aded
commit 15c0e242d7
6 changed files with 119 additions and 99 deletions

View File

@@ -2876,4 +2876,9 @@ public class BinaryJedis implements BinaryJedisCommands {
public Client getClient() { public Client getClient() {
return client; return client;
} }
public String bgrewriteof() {
client.bgrewriteaof();
return client.getStatusCodeReply();
}
} }

View File

@@ -214,4 +214,5 @@ public interface Commands {
public void linsert(final String key, final LIST_POSITION where, public void linsert(final String key, final LIST_POSITION where,
final String pivot, final String value); final String pivot, final String value);
public void bgrewriteaof();
} }

View File

@@ -2581,4 +2581,9 @@ public class Jedis extends BinaryJedis implements JedisCommands {
client.linsert(key, where, pivot, value); client.linsert(key, where, pivot, value);
return client.getIntegerReply(); return client.getIntegerReply();
} }
public String bgrewriteof() {
client.bgrewriteaof();
return client.getStatusCodeReply();
}
} }

View File

@@ -406,4 +406,8 @@ public class Pipeline implements Commands {
public List<Object> execute() { public List<Object> execute() {
return client.getAll(); return client.getAll();
} }
public void bgrewriteaof() {
client.bgrewriteaof();
}
} }

View File

@@ -402,5 +402,9 @@ public abstract class PipelineBlock implements Commands {
client.zunionstore(dstkey, params, sets); client.zunionstore(dstkey, params, sets);
} }
public void bgrewriteaof() {
client.bgrewriteaof();
}
public abstract void execute(); public abstract void execute();
} }

View File

@@ -180,10 +180,11 @@ public class StringValuesCommandsTest extends JedisCommandTestBase {
public void incrLargeNumbers() { public void incrLargeNumbers() {
long value = jedis.incr("foo"); long value = jedis.incr("foo");
assertEquals(1, value); assertEquals(1, value);
assertEquals(1L + Integer.MAX_VALUE, (long) jedis.incrBy("foo", Integer.MAX_VALUE)); assertEquals(1L + Integer.MAX_VALUE, (long) jedis.incrBy("foo",
Integer.MAX_VALUE));
} }
@Test @Test(expected = JedisException.class)
public void incrReallyLargeNumbers() { public void incrReallyLargeNumbers() {
jedis.set("foo", Long.toString(Long.MAX_VALUE)); jedis.set("foo", Long.toString(Long.MAX_VALUE));
long value = jedis.incr("foo"); long value = jedis.incr("foo");