private:
Hashtable<int32_t, TransactionPart *> parts = NULL;
Set<int32_t> missingParts = NULL;
- List<int32_t> partsPendingSend = NULL;
+ Vector<int32_t> partsPendingSend = NULL;
bool isComplete = false;
bool hasLastPart = false;
Hashset<KeyValue *> * keyValueGuardSet = NULL;
bool hadServerFailure = false;
public Transaction() {
- parts = new HashMap<Integer, TransactionPart>();
+ parts = new Hashtable<int32_t, TransactionPart>();
keyValueGuardSet = new HashSet<KeyValue>();
keyValueUpdateSet = new HashSet<KeyValue>();
- partsPendingSend = new ArrayList<Integer>();
+ partsPendingSend = new Vector<int32_t>();
}
public void addPartEncode(TransactionPart newPart) {
// Set dead the old one since the new one is a rescued version of this part
previoslySeenPart.setDead();
} else if (newPart.isLastPart()) {
- missingParts = new HashSet<Integer>();
+ missingParts = new HashSet<int32_t>();
hasLastPart = true;
for (int i = 0; i < newPart.getPartNumber(); i++) {
public void setSequenceNumber(int64_t _sequenceNumber) {
sequenceNumber = _sequenceNumber;
- for (Integer i : parts.keySet()) {
+ for (int32_t i : parts.keySet()) {
parts.get(i).setSequenceNumber(sequenceNumber);
}
}
return clientLocalSequenceNumber;
}
- public Map<Integer, TransactionPart> getParts() {
+ public Hashtable<int32_t, TransactionPart> getParts() {
return parts;
}
return transactionStatus;
}
- public void removeSentParts(List<Integer> sentParts) {
+ public void removeSentParts(Vector<int32_t> sentParts) {
nextPartToSend = 0;
if(partsPendingSend.removeAll(sentParts))
{
return isComplete;
}
- public Pair<Long, Long> getId() {
+ public Pair<int64_t, int64_t> getId() {
return transactionId;
}
isDead = true;
// Make all the parts of this transaction dead
- for (Integer partNumber : parts.keySet()) {
+ for (int32_t partNumber : parts.keySet()) {
TransactionPart part = parts.get(partNumber);
part.setDead();
}
}
}
- public bool evaluateGuard(Map<IoTString, KeyValue> committedKeyValueTable, Map<IoTString, KeyValue> speculatedKeyValueTable, Map<IoTString, KeyValue> pendingTransactionSpeculatedKeyValueTable) {
+ public bool evaluateGuard(Hashtable<IoTString, KeyValue> committedKeyValueTable, Hashtable<IoTString, KeyValue> speculatedKeyValueTable, Hashtable<IoTString, KeyValue> pendingTransactionSpeculatedKeyValueTable) {
for (KeyValue kvGuard : keyValueGuardSet) {
// First check if the key is in the speculative table, this is the value of the latest assumption