public Object get() { return client.getOne(); } }
/** * Syncronize pipeline by reading all responses. This operation closes the pipeline. In order to * get return values from pipelined commands, capture the different Response<?> of the * commands you execute. */ public void sync() { for (Client client : clients) { generateResponse(client.getOne()); } }
private Object getEvalResult() { return evalResult(client.getOne()); }
/** * Execute an arbitrary on the supplied {@link Jedis} instance. * * @param command the command. * @param keys must not be {@literal null}, may be empty. * @param args must not be {@literal null}, may be empty. * @param jedis must not be {@literal null}. * @return the response, can be be {@literal null}. */ static <T> T execute(String command, byte[][] keys, byte[][] args, Supplier<Jedis> jedis) { return execute(command, keys, args, jedis, it -> (T) it.getOne()); }
@Nullable @Override public <T> T execute(String command, byte[] key, Collection<byte[]> args) { return execute(command, key, args, it -> (T) it.getOne()); }
/** * Syncronize pipeline by reading all responses. This operation closes the pipeline. Whenever * possible try to avoid using this version and use ShardedJedisPipeline.sync() as it won't go * through all the responses and generate the right response type (usually it is a waste of time). * @return A list of all the responses in the order you executed them. */ public List<Object> syncAndReturnAll() { List<Object> formatted = new ArrayList<Object>(); for (Client client : clients) { formatted.add(generateResponse(client.getOne()).get()); } return formatted; }
public Transaction multi() { client.multi(); client.getOne(); // expected OK transaction = new Transaction(client); return transaction; }
@Override public Object eval(byte[] script, byte[] keyCount, byte[]... params) { client.setTimeoutInfinite(); try { client.eval(script, keyCount, params); return client.getOne(); } finally { client.rollbackTimeout(); } }
@Override public Object evalsha(byte[] sha1, int keyCount, byte[]... params) { client.setTimeoutInfinite(); try { client.evalsha(sha1, keyCount, params); return client.getOne(); } finally { client.rollbackTimeout(); } }
private void innerSync(List<Object> formatted) { try { Response<?> response; Object data; for (Client client : clients) { response = generateResponse(client.getOne()); if (null != formatted) { data = response.get(); formatted.add(data); } } } catch (JedisRedirectionException jre) { throw jre; } finally { close(); } }
@Nullable @Override public <T> T execute(String command, byte[] key, Collection<byte[]> args) { return execute(command, key, args, it -> (T) it.getOne()); }
/** * Execute an arbitrary on the supplied {@link Jedis} instance. * * @param command the command. * @param keys must not be {@literal null}, may be empty. * @param args must not be {@literal null}, may be empty. * @param jedis must not be {@literal null}. * @return the response, can be be {@literal null}. */ static <T> T execute(String command, byte[][] keys, byte[][] args, Supplier<Jedis> jedis) { return execute(command, keys, args, jedis, it -> (T) it.getOne()); }
/** * Execute an arbitrary on the supplied {@link Jedis} instance. * * @param command the command. * @param keys must not be {@literal null}, may be empty. * @param args must not be {@literal null}, may be empty. * @param jedis must not be {@literal null}. * @return the response, can be be {@literal null}. */ static <T> T execute(String command, byte[][] keys, byte[][] args, Supplier<Jedis> jedis) { return execute(command, keys, args, jedis, it -> (T) it.getOne()); }
/** * Synchronize pipeline by reading all responses. This operation closes the pipeline. In order to * get return values from pipelined commands, capture the different Response<?> of the * commands you execute. */ public void sync() { for (Client client : clients) { generateResponse(client.getOne()); } }
@Nullable @Override public <T> T execute(String command, byte[] key, Collection<byte[]> args) { return execute(command, key, args, it -> (T) it.getOne()); }
public Transaction multi() { client.multi(); client.getOne(); // expected OK transaction = new Transaction(client); return transaction; }
@Override public Object eval(final byte[] script, final byte[] keyCount, final byte[]... params) { client.setTimeoutInfinite(); try { client.eval(script, keyCount, params); return client.getOne(); } finally { client.rollbackTimeout(); } }
@Override public Object evalsha(final byte[] sha1, final int keyCount, final byte[]... params) { client.setTimeoutInfinite(); try { client.evalsha(sha1, keyCount, params); return client.getOne(); } finally { client.rollbackTimeout(); } }
@Override public Double zincrby(final String key, final double increment, final String member, final ZIncrByParams params) { checkIsInMultiOrPipeline(); client.zincrby(key, increment, member, params); return BuilderFactory.DOUBLE.build(client.getOne()); }
@Override public Double zincrby(final byte[] key, final double increment, final byte[] member, final ZIncrByParams params) { checkIsInMultiOrPipeline(); client.zincrby(key, increment, member, params); return BuilderFactory.DOUBLE.build(client.getOne()); }