+ fix return signature for closePipeline method

This commit is contained in:
Costin Leau
2011-03-14 12:37:31 +02:00
parent 146257b1f8
commit aef3cdece0
4 changed files with 22 additions and 17 deletions

View File

@@ -1119,7 +1119,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection {
}
@Override
public List<Object> closePipeline() {
public List<byte[]> closePipeline() {
return delegate.closePipeline();
}

View File

@@ -95,5 +95,5 @@ public interface RedisConnection extends RedisCommands {
*
* @return the result of the executed commands.
*/
List<Object> closePipeline();
List<byte[]> closePipeline();
}

View File

@@ -186,10 +186,14 @@ public class JedisConnection implements RedisConnection {
}
}
@SuppressWarnings("unchecked")
@Override
public List<Object> closePipeline() {
public List<byte[]> closePipeline() {
if (pipeline != null) {
return pipeline.execute();
List execute = pipeline.execute();
if (execute != null && !execute.isEmpty()) {
return (List<byte[]>) execute;
}
}
return Collections.emptyList();
}
@@ -217,7 +221,7 @@ public class JedisConnection implements RedisConnection {
else {
pipeline.sort(key);
}
return null;
}
return (sortParams != null ? jedis.sort(key, sortParams) : jedis.sort(key));
@@ -741,7 +745,8 @@ public class JedisConnection implements RedisConnection {
for (byte[] key : keys) {
if (isPipelined()) {
pipeline.watch(key);
} else {
}
else {
jedis.watch(key);
}
}
@@ -1096,11 +1101,11 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
final List<byte[]> args = new ArrayList<byte[]>();
for (final byte[] arg : keys) {
args.add(arg);
}
args.add(Protocol.toByteArray(timeout));
pipeline.blpop(args.toArray(new byte[args.size()][]));
return null;
args.add(arg);
}
args.add(Protocol.toByteArray(timeout));
pipeline.blpop(args.toArray(new byte[args.size()][]));
return null;
}
return jedis.blpop(timeout, keys);
} catch (Exception ex) {
@@ -1117,11 +1122,11 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
final List<byte[]> args = new ArrayList<byte[]>();
for (final byte[] arg : keys) {
args.add(arg);
}
args.add(Protocol.toByteArray(timeout));
pipeline.brpop(args.toArray(new byte[args.size()][]));
return null;
args.add(arg);
}
args.add(Protocol.toByteArray(timeout));
pipeline.brpop(args.toArray(new byte[args.size()][]));
return null;
}
return jedis.brpop(timeout, keys);
} catch (Exception ex) {

View File

@@ -112,7 +112,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
public List<Object> closePipeline() {
public List<byte[]> closePipeline() {
return Collections.emptyList();
}