@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); }
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); }
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)); }
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); }
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); }
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); }
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); }