Пример #1
0
 @SuppressWarnings("unchecked")
 public Future<Long> zadd(K key, Object... scoresAndValues) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key);
   for (int i = 0; i < scoresAndValues.length; i += 2) {
     args.add((Double) scoresAndValues[i]);
     args.addValue((V) scoresAndValues[i + 1]);
   }
   return dispatch(ZADD, new IntegerOutput<K, V>(codec), args);
 }
Пример #2
0
 public <T> Future<T> eval(V script, ScriptOutputType type, K[] keys, V... values) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   args.addValue(script).add(keys.length).addKeys(keys).addValues(values);
   CommandOutput<K, V, T> output = newScriptOutput(codec, type);
   return dispatch(EVAL, output, args);
 }