getBuckets deprecated, use findBuckets

pull/337/head
Nikita 9 years ago
parent 576310dfdd
commit 3e5ea61ade

@ -156,18 +156,24 @@ public class Redisson implements RedissonClient {
} }
@Override @Override
public <V> List<RBucket<V>> getBuckets(String pattern) { public <V> List<RBucket<V>> findBuckets(String pattern) {
Future<Collection<String>> r = commandExecutor.readAllAsync(RedisCommands.KEYS, pattern); Future<Collection<String>> r = commandExecutor.readAllAsync(RedisCommands.KEYS, pattern);
Collection<String> keys = commandExecutor.get(r); Collection<String> keys = commandExecutor.get(r);
List<RBucket<V>> buckets = new ArrayList<RBucket<V>>(keys.size()); List<RBucket<V>> buckets = new ArrayList<RBucket<V>>(keys.size());
for (Object key : keys) { for (String key : keys) {
if(key != null) { if(key == null) {
buckets.add(this.<V>getBucket(key.toString())); continue;
} }
buckets.add(this.<V>getBucket(key));
} }
return buckets; return buckets;
} }
@Override
public <V> List<RBucket<V>> getBuckets(String pattern) {
return findBuckets(pattern);
}
@Override @Override
public <V> RHyperLogLog<V> getHyperLogLog(String name) { public <V> RHyperLogLog<V> getHyperLogLog(String name) {
return new RedissonHyperLogLog<V>(commandExecutor, name); return new RedissonHyperLogLog<V>(commandExecutor, name);

@ -122,7 +122,25 @@ public interface RedissonClient {
/** /**
* Returns a list of object holder instances by a key pattern. * Returns a list of object holder instances by a key pattern.
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
* h[^e]llo matches hallo, hbllo, ... but not hello
* h[a-b]llo matches hallo and hbllo
*
* Use \ to escape special characters if you want to match them verbatim.
*
* @param pattern
* @return
*/
<V> List<RBucket<V>> findBuckets(String pattern);
/**
* Use {@link #findBuckets(String)}
*/ */
@Deprecated
<V> List<RBucket<V>> getBuckets(String pattern); <V> List<RBucket<V>> getBuckets(String pattern);
/** /**

Loading…
Cancel
Save