refactoring

pull/1461/head
Nikita 7 years ago
parent 5ebae655ec
commit f1b10deb5d

@ -60,8 +60,8 @@ public class RedissonBuckets implements RBuckets {
@Override @Override
public <V> List<RBucket<V>> find(String pattern) { public <V> List<RBucket<V>> find(String pattern) {
Collection<String> keys = commandExecutor.get(commandExecutor.<List<String>, String>readAllAsync(RedisCommands.KEYS, pattern)); Iterable<String> keys = redisson.getKeys().getKeysByPattern(pattern);
List<RBucket<V>> buckets = new ArrayList<RBucket<V>>(keys.size()); List<RBucket<V>> buckets = new ArrayList<RBucket<V>>();
for (String key : keys) { for (String key : keys) {
if(key == null) { if(key == null) {
continue; continue;

@ -34,6 +34,7 @@ import org.redisson.api.RBucketReactive;
import org.redisson.api.RDequeReactive; import org.redisson.api.RDequeReactive;
import org.redisson.api.RFuture; import org.redisson.api.RFuture;
import org.redisson.api.RHyperLogLogReactive; import org.redisson.api.RHyperLogLogReactive;
import org.redisson.api.RKeys;
import org.redisson.api.RKeysReactive; import org.redisson.api.RKeysReactive;
import org.redisson.api.RLexSortedSetReactive; import org.redisson.api.RLexSortedSetReactive;
import org.redisson.api.RListMultimapReactive; import org.redisson.api.RListMultimapReactive;
@ -162,10 +163,10 @@ public class RedissonReactive implements RedissonReactiveClient {
@Override @Override
public <V> List<RBucketReactive<V>> findBuckets(String pattern) { public <V> List<RBucketReactive<V>> findBuckets(String pattern) {
RFuture<Collection<String>> r = commandExecutor.readAllAsync(RedisCommands.KEYS, pattern); RKeys redissonKeys = new RedissonKeys(commandExecutor);
Collection<String> keys = commandExecutor.get(r); Iterable<String> keys = redissonKeys.getKeysByPattern(pattern);
List<RBucketReactive<V>> buckets = new ArrayList<RBucketReactive<V>>(keys.size()); List<RBucketReactive<V>> buckets = new ArrayList<RBucketReactive<V>>();
for (Object key : keys) { for (Object key : keys) {
if(key != null) { if(key != null) {
buckets.add(this.<V>getBucket(key.toString())); buckets.add(this.<V>getBucket(key.toString()));

Loading…
Cancel
Save