flushdb and flushall methods are moved to RKeys. #334

pull/365/head
Nikita 9 years ago
parent 4a3f378ab5
commit 535bd0a464

@ -533,13 +533,15 @@ public interface RedissonClient {
NodesGroup<ClusterNode> getClusterNodesGroup(); NodesGroup<ClusterNode> getClusterNodesGroup();
/** /**
* Delete all the keys of the currently selected database * Use {@link RKeys#flushdb()}
*/ */
@Deprecated
void flushdb(); void flushdb();
/** /**
* Delete all the keys of all the existing databases * Use {@link RKeys#flushall()}
*/ */
@Deprecated
void flushall(); void flushall();
/** /**

@ -278,4 +278,24 @@ public class RedissonKeys implements RKeys {
}); });
} }
@Override
public void flushdb() {
commandExecutor.get(flushdbAsync());
}
@Override
public Future<Void> flushdbAsync() {
return commandExecutor.writeAllAsync(RedisCommands.FLUSHDB);
}
@Override
public void flushall() {
commandExecutor.get(flushallAsync());
}
@Override
public Future<Void> flushallAsync() {
return commandExecutor.writeAllAsync(RedisCommands.FLUSHALL);
}
} }

@ -95,4 +95,14 @@ public interface RKeys extends RKeysAsync {
*/ */
Long count(); Long count();
/**
* Delete all keys of currently selected database
*/
void flushdb();
/**
* Delete all keys of all existing databases
*/
void flushall();
} }

@ -77,4 +77,15 @@ public interface RKeysAsync {
* @return * @return
*/ */
Future<Long> countAsync(); Future<Long> countAsync();
/**
* Delete all keys of currently selected database
*/
Future<Void> flushdbAsync();
/**
* Delete all keys of all existing databases
*/
Future<Void> flushallAsync();
} }

Loading…
Cancel
Save