Esempio n. 1
0
  @Override
  public <V> Map<String, V> get(String... keys) {
    if (keys.length == 0) {
      return Collections.emptyMap();
    }

    RedisCommand<Map<Object, Object>> command =
        new RedisCommand<Map<Object, Object>>(
            "MGET", new MapGetAllDecoder(Arrays.<Object>asList(keys), 0), ValueType.OBJECTS);
    Future<Map<String, V>> future =
        commandExecutor.readAsync(keys[0], new DelegateDecoderCodec(codec), command, keys);
    return commandExecutor.get(future);
  }
Esempio n. 2
0
 @Override
 public <V> List<RBucket<V>> find(String pattern) {
   Collection<String> keys =
       commandExecutor.get(
           commandExecutor.<List<String>, String>readAllAsync(RedisCommands.KEYS, pattern));
   List<RBucket<V>> buckets = new ArrayList<RBucket<V>>(keys.size());
   for (String key : keys) {
     if (key == null) {
       continue;
     }
     buckets.add(redisson.<V>getBucket(key, codec));
   }
   return buckets;
 }