Reformat all files in the project according to java conventions.
This commit is contained in:
@@ -11,27 +11,27 @@ public class ShardedJedisPipeline extends PipelineBase {
|
||||
private Queue<Client> clients = new LinkedList<Client>();
|
||||
|
||||
private static class FutureResult {
|
||||
private Client client;
|
||||
private Client client;
|
||||
|
||||
public FutureResult(Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
public FutureResult(Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public Object get() {
|
||||
return client.getOne();
|
||||
}
|
||||
public Object get() {
|
||||
return client.getOne();
|
||||
}
|
||||
}
|
||||
|
||||
public void setShardedJedis(BinaryShardedJedis jedis) {
|
||||
this.jedis = jedis;
|
||||
this.jedis = jedis;
|
||||
}
|
||||
|
||||
public List<Object> getResults() {
|
||||
List<Object> r = new ArrayList<Object>();
|
||||
for (FutureResult fr : results) {
|
||||
r.add(fr.get());
|
||||
}
|
||||
return r;
|
||||
List<Object> r = new ArrayList<Object>();
|
||||
for (FutureResult fr : results) {
|
||||
r.add(fr.get());
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,30 +40,30 @@ public class ShardedJedisPipeline extends PipelineBase {
|
||||
* the different Response<?> of the commands you execute.
|
||||
*/
|
||||
public void sync() {
|
||||
for (Client client : clients) {
|
||||
generateResponse(client.getOne());
|
||||
}
|
||||
for (Client client : clients) {
|
||||
generateResponse(client.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).
|
||||
*
|
||||
* 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;
|
||||
List<Object> formatted = new ArrayList<Object>();
|
||||
for (Client client : clients) {
|
||||
formatted.add(generateResponse(client.getOne()).get());
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be removed in Jedis 3.0. Use the methods that return Response's and call
|
||||
* sync().
|
||||
* This method will be removed in Jedis 3.0. Use the methods that return
|
||||
* Response's and call sync().
|
||||
*/
|
||||
@Deprecated
|
||||
public void execute() {
|
||||
@@ -71,17 +71,17 @@ public class ShardedJedisPipeline extends PipelineBase {
|
||||
|
||||
@Override
|
||||
protected Client getClient(String key) {
|
||||
Client client = jedis.getShard(key).getClient();
|
||||
clients.add(client);
|
||||
results.add(new FutureResult(client));
|
||||
return client;
|
||||
Client client = jedis.getShard(key).getClient();
|
||||
clients.add(client);
|
||||
results.add(new FutureResult(client));
|
||||
return client;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Client getClient(byte[] key) {
|
||||
Client client = jedis.getShard(key).getClient();
|
||||
clients.add(client);
|
||||
results.add(new FutureResult(client));
|
||||
return client;
|
||||
Client client = jedis.getShard(key).getClient();
|
||||
clients.add(client);
|
||||
results.add(new FutureResult(client));
|
||||
return client;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user