Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public Future<Long> bitopAnd(K destination, K... keys) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   args.add(AND).addKey(destination).addKeys(keys);
   return dispatch(BITOP, new IntegerOutput<K, V>(codec), args);
 }
Exemplo n.º 3
0
 public void shutdown(boolean save) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   dispatch(SHUTDOWN, new StatusOutput<K, V>(codec), save ? args.add(SAVE) : args.add(NOSAVE));
 }
Exemplo n.º 4
0
 public Future<List<Boolean>> scriptExists(String... digests) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec).add(EXISTS);
   for (String sha : digests) args.add(sha);
   return dispatch(SCRIPT, new BooleanListOutput<K, V>(codec), args);
 }
Exemplo n.º 5
0
 public Future<String> migrate(String host, int port, K key, int db, long timeout) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   args.add(host).add(port).addKey(key).add(db).add(timeout);
   return dispatch(MIGRATE, new StatusOutput<K, V>(codec), args);
 }
Exemplo n.º 6
0
 public <T> Future<T> evalsha(String digest, ScriptOutputType type, K[] keys, V... values) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   args.add(digest).add(keys.length).addKeys(keys).addValues(values);
   CommandOutput<K, V, T> output = newScriptOutput(codec, type);
   return dispatch(EVALSHA, output, args);
 }
Exemplo n.º 7
0
 public Future<Long> bitopNot(K destination, K source) {
   CommandArgs<K, V> args = new CommandArgs<K, V>(codec);
   args.add(NOT).addKey(destination).addKey(source);
   return dispatch(BITOP, new IntegerOutput<K, V>(codec), args);
 }