}
// Get the transaction sequence numbers and sort from oldest to newest
- Vector<int64_t> *transactionSequenceNumbers = new Vector<int64_t>(liveTransactionBySequenceNumberTable->keySet());
+ Vector<int64_t> *transactionSequenceNumbers = new Vector<int64_t>();
+ {
+ SetIterator<int64_t, Transaction *> * trit = getKeyIterator(liveTransactionBySequenceNumberTable);
+ while(trit->hasNext())
+ transactionSequenceNumbers->add(trit->next());
+ delete trit;
+ }
qsort(transactionSequenceNumbers->expose(), transactionSequenceNumbers->size(), sizeof(int64_t), compareInt64);
// Collection of key value pairs that are
// The last transaction arbitrated on
int64_t lastTransactionCommitted = -1;
Hashset<Abort *> *generatedAborts = new Hashset<Abort *>();
-
- for (int64_t transactionSequenceNumber : transactionSequenceNumbers) {
+ uint tsnSize = transactionSequenceNumbers->size();
+ for(uint i=0; i<tsnSize; i++) {
+ int64_t transactionSequenceNumber = transactionSequenceNumbers->get(i);
Transaction *transaction = liveTransactionBySequenceNumberTable->get(transactionSequenceNumber);
-
-
// Check if this machine arbitrates for this transaction if not
// then we cant arbitrate this transaction
if (transaction->getArbitrator() != localMachineId) {
// update the largest transaction seen by arbitrator from server
- if (lastTransactionSeenFromMachineFromServer->get(transaction->getMachineId()) == NULL) {
+ if (!lastTransactionSeenFromMachineFromServer->contains(transaction->getMachineId())) {
lastTransactionSeenFromMachineFromServer->put(transaction->getMachineId(), transaction->getClientLocalSequenceNumber());
} else {
int64_t lastTransactionSeenFromMachine = lastTransactionSeenFromMachineFromServer->get(transaction->getMachineId());