refactored pipelinebase so it is usable to implement SharedJedisPipeline as well.

This commit is contained in:
samhendley
2013-01-10 02:29:39 -05:00
parent c8ddd237c3
commit 6b5fccdc0a
6 changed files with 597 additions and 1839 deletions

View File

@@ -8,7 +8,7 @@ import java.util.List;
/**
* Transaction is nearly identical to Pipeline, only differences are the multi/discard behaviors
*/
public class Transaction extends PipelineBase {
public class Transaction extends MultiKeyPipelineBase {
protected boolean inTransaction = true;
@@ -20,6 +20,16 @@ public class Transaction extends PipelineBase {
this.client = client;
}
@Override
protected Client getClient(String key) {
return client;
}
@Override
protected Client getClient(byte[] key) {
return client;
}
public List<Object> exec() {
client.exec();
client.getAll(1); // Discard all but the last reply