+ add flushDB to RedisCommands + implementations

This commit is contained in:
Costin Leau
2010-11-25 20:01:38 +02:00
parent f738efff6d
commit 9996eddd5c
3 changed files with 23 additions and 0 deletions

View File

@@ -50,4 +50,5 @@ public interface RedisCommands extends RedisTxCommands, RedisStringCommands, Red
void select(int dbIndex);
void flushDb();
}

View File

@@ -120,6 +120,19 @@ public class JedisConnection implements RedisConnection {
}
}
@Override
public void flushDb() {
try {
if (isQueueing()) {
transaction.flushDB();
}
jedis.flushDB();
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
public Integer del(byte[]... keys) {
try {

View File

@@ -84,6 +84,15 @@ public class JredisConnection implements RedisConnection {
}
}
@Override
public void flushDb() {
try {
jredis.flushall();
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
public Integer del(byte[]... keys) {
try {