edits
authorbdemsky <bdemsky@uci.edu>
Sat, 20 Jan 2018 07:01:37 +0000 (23:01 -0800)
committerbdemsky <bdemsky@uci.edu>
Sat, 20 Jan 2018 07:01:37 +0000 (23:01 -0800)
13 files changed:
version2/src/C/Abort.cc
version2/src/C/Abort.h
version2/src/C/ArbitrationRound.cc
version2/src/C/ArbitrationRound.h
version2/src/C/CommitPart.cc
version2/src/C/CommitPart.h
version2/src/C/IoTString.h
version2/src/C/Table.cc
version2/src/C/Table.h
version2/src/C/Transaction.cc
version2/src/C/Transaction.h
version2/src/C/TransactionPart.cc
version2/src/C/TransactionPart.h

index 77e16537345073da6c704f84d3d61ac13ddafe04..f653e97156d864dde2df5ae36ea57856f5a547e3 100644 (file)
@@ -8,7 +8,7 @@ Abort::Abort(Slot *slot, int64_t _transactionClientLocalSequenceNumber, int64_t
        transactionMachineId(_transactionMachineId),
        transactionArbitrator(_transactionArbitrator),
        arbitratorLocalSequenceNumber(_arbitratorLocalSequenceNumber),
-       abortId(new Pair<int64_t, int64_t>(transactionMachineId, transactionClientLocalSequenceNumber)) {
+       abortId(Pair<int64_t, int64_t>(transactionMachineId, transactionClientLocalSequenceNumber)) {
 }
 
 Abort::Abort(Slot *slot, int64_t _transactionClientLocalSequenceNumber, int64_t _transactionSequenceNumber, int64_t _sequenceNumber,  int64_t _transactionMachineId, int64_t _transactionArbitrator, int64_t _arbitratorLocalSequenceNumber) :
@@ -19,7 +19,7 @@ Abort::Abort(Slot *slot, int64_t _transactionClientLocalSequenceNumber, int64_t
        transactionMachineId(_transactionMachineId),
        transactionArbitrator(_transactionArbitrator),
        arbitratorLocalSequenceNumber(_arbitratorLocalSequenceNumber),
-       abortId(new Pair<int64_t, int64_t>(transactionMachineId, transactionClientLocalSequenceNumber)) {
+       abortId(Pair<int64_t, int64_t>(transactionMachineId, transactionClientLocalSequenceNumber)) {
 }
 
 Entry *Abort_decode(Slot *slot, ByteBuffer *bb) {
index 4a420d1d8971e5fb37928775778d0aab5545ec84..84b8c41d0ade937c677b401f7382f297484044b8 100644 (file)
@@ -12,13 +12,13 @@ private:
        int64_t transactionMachineId;
        int64_t transactionArbitrator;
        int64_t arbitratorLocalSequenceNumber;
-       Pair<int64_t, int64_t> *abortId;
+       Pair<int64_t, int64_t> abortId;
 
 public:
        Abort(Slot *slot, int64_t _transactionClientLocalSequenceNumber, int64_t _transactionSequenceNumber,  int64_t _transactionMachineId, int64_t _transactionArbitrator, int64_t _arbitratorLocalSequenceNumber);
        Abort(Slot *slot, int64_t _transactionClientLocalSequenceNumber, int64_t _transactionSequenceNumber, int64_t _sequenceNumber,  int64_t _transactionMachineId, int64_t _transactionArbitrator, int64_t _arbitratorLocalSequenceNumber);
 
-       Pair<int64_t, int64_t> *getAbortId() {return abortId;}
+       Pair<int64_t, int64_t> getAbortId() {return abortId;}
 
        int64_t getTransactionMachineId() { return transactionMachineId; }
        int64_t getTransactionSequenceNumber()  { return transactionSequenceNumber; }
index da21dda20218dcdd7939d3538730d69b94ee6df1..3ddf5cb49852141d216a3f6783cf70dfdabd3e4a 100644 (file)
@@ -17,33 +17,19 @@ ArbitrationRound::ArbitrationRound(Commit *_commit, Hashset<Abort *> *_abortsBef
        currentSize += abortsBefore->size();
 }
 
-/*
-   void ArbitrationRound::generateParts() {
-   if (didGenerateParts) {
-    return;
-   }
-   parts = new Vector<Entry *>((Vector<Entry *> *)abortsBefore);
-   if (commit != NULL) {
-    parts->addAll(commit->getParts()->values());
-   }
-   }*/
+ArbitrationRound::~ArbitrationRound() {
+       delete abortsBefore;
+       delete parts;
+}
 
 Vector<Entry *> *ArbitrationRound::getParts() {
        return parts;
 }
 
-/*
-   void ArbitrationRound::removeParts(Vector<Entry *> * removeParts) {
-   parts->removeAll(removeParts);
-   didSendPart = true;
-   }
- */
-
 bool ArbitrationRound::isDoneSending() {
        if ((commit == NULL) && abortsBefore->isEmpty()) {
                return true;
        }
-
        return parts->isEmpty();
 }
 
@@ -85,10 +71,9 @@ int ArbitrationRound::getCurrentSize() {
 }
 
 bool ArbitrationRound::isFull() {
-       return currentSize >= MAX_PARTS;
+       return currentSize >= ArbitrationRound_MAX_PARTS;
 }
 
 bool ArbitrationRound::getDidSendPart() {
        return didSendPart;
 }
-
index b91469d1340a66a93584d7e4dacf15161ef72793..ba4ed86f1a201bab71559af15a33c01b63d473b9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ARBITRATIONROUND_H
 #define ARBITRATIONROUND_H
 
-#define MAX_PARTS 10
+#define ArbitrationRound_MAX_PARTS 10
 #include "common.h"
 
 class ArbitrationRound {
index ea7c36e13827f2aee97c1545f4852d60167461c0..3f3208d220ebbcfd04b14810f07e95c481272905 100644 (file)
@@ -9,8 +9,12 @@ CommitPart::CommitPart(Slot *s, int64_t _machineId, int64_t _sequenceNumber, int
        partNumber(_partNumber),
        fldisLastPart(_isLastPart),
        data(_data),
-       partId(new Pair<int64_t, int32_t>(sequenceNumber, partNumber)),
-       commitId(new Pair<int64_t, int64_t>(machineId, sequenceNumber)) {
+       partId(Pair<int64_t, int32_t>(sequenceNumber, partNumber)),
+       commitId(Pair<int64_t, int64_t>(machineId, sequenceNumber)) {
+}
+
+CommitPart::~CommitPart() {
+       delete data;
 }
 
 int CommitPart::getSize() {
@@ -36,11 +40,11 @@ Array<char> *CommitPart::getData() {
        return data;
 }
 
-Pair<int64_t, int32_t> *CommitPart::getPartId() {
+Pair<int64_t, int32_t> CommitPart::getPartId() {
        return partId;
 }
 
-Pair<int64_t, int64_t> *CommitPart::getCommitId() {
+Pair<int64_t, int64_t> CommitPart::getCommitId() {
        return commitId;
 }
 
@@ -97,5 +101,5 @@ char CommitPart::getType() {
 }
 
 Entry *CommitPart::getCopy(Slot *s) {
-       return new CommitPart(s, machineId, sequenceNumber, transactionSequenceNumber, partNumber, data, fldisLastPart);
+       return new CommitPart(s, machineId, sequenceNumber, transactionSequenceNumber, partNumber, new Array<char>(data), fldisLastPart);
 }
index e0a0d91b4c5f7cc659a298520acf4f761e1f3295..8c8e926ac260eaf23a39efb70c502d9512667587 100644 (file)
@@ -17,18 +17,19 @@ private:
        bool fldisLastPart;
        Array<char> *data;
 
-       Pair<int64_t, int32_t> *partId;
-       Pair<int64_t, int64_t> *commitId;
+       Pair<int64_t, int32_t> partId;
+       Pair<int64_t, int64_t> commitId;
 
 public:
        CommitPart(Slot *s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, Array<char> *_data, bool _isLastPart);
+       ~CommitPart();
        int getSize();
        void setSlot(Slot *s);
        int getPartNumber();
        int getDataSize();
        Array<char> *getData();
-       Pair<int64_t, int32_t> *getPartId();
-       Pair<int64_t, int64_t> *getCommitId();
+       Pair<int64_t, int32_t> getPartId();
+       Pair<int64_t, int64_t> getCommitId();
        bool isLastPart();
        int64_t getMachineId();
        int64_t getTransactionSequenceNumber();
index 8c07f8e56f4bb9aa9818fc16b9e9b458e5bf34e7..a7343db5bf0b564d5c1124642f5fa6aef3bd7092 100644 (file)
@@ -2,7 +2,7 @@
 #define IOTSTRING_H
 
 #include "array.h"
-
+#include <string.h>
 /**
  * IoTString wraps the underlying char string.
  * @author Brian Demsky <bdemsky@uci.edu>
@@ -21,7 +21,15 @@ private:
 
 public:
        IoTString(Array<char> *_array) : array(new Array<char>(_array)) {}
-       ~IoTString() {}
+       IoTString(const char *_array) {
+               int32_t len = strlen(_array);
+               array = new Array<char>(len);
+               strcpy(array->internalArray(), _array);
+       }
+
+       ~IoTString() {
+               delete array;
+       }
 
        /**
         * Internal method to grab a reference to our char array.  Caller
index 22d62a250b63bfab30dd294108f16c3dfb6222c8..d598f15cfda3939f9d65c9f6fbf6876530c18622 100644 (file)
@@ -150,15 +150,15 @@ void Table::init() {
        speculatedKeyValueTable = new Hashtable<IoTString *, KeyValue *>();
        pendingTransactionSpeculatedKeyValueTable = new Hashtable<IoTString *, KeyValue *>();
        liveNewKeyTable = new Hashtable<IoTString *, NewKey *>();
-       lastMessageTable = new Hashtable<int64_t, Pair<int64_t, Liveness *> *>();
+       lastMessageTable = new Hashtable<int64_t, Pair<int64_t, Liveness *> >();
        rejectedMessageWatchVectorTable = new Hashtable<int64_t, Hashset<RejectedMessage *> * >();
        arbitratorTable = new Hashtable<IoTString *, int64_t>();
-       liveAbortTable = new Hashtable<Pair<int64_t, int64_t> *, Abort *>();
-       newTransactionParts = new Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t> *, TransactionPart *> *>();
-       newCommitParts = new Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t> *, CommitPart *> *>();
+       liveAbortTable = new Hashtable<Pair<int64_t, int64_t>, Abort *>();
+       newTransactionParts = new Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, TransactionPart *> *>();
+       newCommitParts = new Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, CommitPart *> *>();
        lastArbitratedTransactionNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
        liveTransactionBySequenceNumberTable = new Hashtable<int64_t, Transaction *>();
-       liveTransactionByTransactionIdTable = new Hashtable<Pair<int64_t, int64_t> *, Transaction *>();
+       liveTransactionByTransactionIdTable = new Hashtable<Pair<int64_t, int64_t>, Transaction *>();
        liveCommitsTable = new Hashtable<int64_t, Hashtable<int64_t, Commit *> >();
        liveCommitsByKeyTable = new Hashtable<IoTString *, Commit *>();
        lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
@@ -168,7 +168,7 @@ void Table::init() {
        transactionPartsSent = new Hashtable<Transaction *, Vector<int32_t> *>();
        outstandingTransactionStatus = new Hashtable<int64_t, TransactionStatus *>();
        liveAbortsGeneratedByLocal = new Hashtable<int64_t, Abort *>();
-       offlineTransactionsCommittedAndAtServer = new Hashset<Pair<int64_t, int64_t> *>();
+       offlineTransactionsCommittedAndAtServer = new Hashset<Pair<int64_t, int64_t> >();
        localCommunicationTable = new Hashtable<int64_t, Pair<IoTString *, int32_t> >();
        lastTransactionSeenFromMachineFromServer = new Hashtable<int64_t, int64_t>();
        pendingSendArbitrationRounds = new Vector<ArbitrationRound *>();
@@ -411,7 +411,7 @@ TransactionStatus *Table::commitTransaction() {
                                continue;
                        }
 
-                       Pair<bool, bool> *sendReturn = sendTransactionToLocal(transaction);
+                       Pair<bool, bool> sendReturn = sendTransactionToLocal(transaction);
 
                        if (sendReturn->getFirst()) {
                                // Failed to contact over local
@@ -456,7 +456,7 @@ bool Table::sendToServer(NewKey *newKey) {
                        Array<Slot *> *newSlots = cloud->getSlots(sequenceNumber + 1);
                        if (newSlots->length() == 0) {
                                fromRetry = true;
-                               ThreeTuple<bool, bool, Array<Slot *> *> *sendSlotsReturn = sendSlotsToServer(lastSlotAttemptedToSend, lastNewSize, lastIsNewKey);
+                               ThreeTuple<bool, bool, Array<Slot *> *> sendSlotsReturn = sendSlotsToServer(lastSlotAttemptedToSend, lastNewSize, lastIsNewKey);
 
                                if (sendSlotsReturn->getFirst()) {
                                        if (newKey != NULL) {
@@ -850,7 +850,7 @@ Pair<bool, bool> Table::sendTransactionToLocal(Transaction *transaction) {
 
        if (localCommunicationInformation == NULL) {
                // Cant talk to that device locally so do nothing
-               return new Pair<bool, bool>(true, false);
+               return Pair<bool, bool>(true, false);
        }
 
        // Get the size of the send data
@@ -882,7 +882,7 @@ Pair<bool, bool> Table::sendTransactionToLocal(Transaction *transaction) {
 
        if (returnData == NULL) {
                // Could not contact server
-               return new Pair<bool, bool>(true, false);
+               return Pair<bool, bool>(true, false);
        }
 
        // Decode the data
@@ -926,7 +926,7 @@ Pair<bool, bool> Table::sendTransactionToLocal(Transaction *transaction) {
                }
        }
 
-       return new Pair<bool, bool>(false, true);
+       return Pair<bool, bool>(false, true);
 }
 
 Array<char> *Table::acceptDataFromLocal(Array<char> *data) {
@@ -1036,7 +1036,7 @@ Array<char> *Table::acceptDataFromLocal(Array<char> *data) {
        return returnData;
 }
 
-ThreeTuple<bool, bool, Array<Slot *> *> *Table::sendSlotsToServer(Slot *slot, int newSize, bool isNewKey) {
+ThreeTuple<bool, bool, Array<Slot *> *> Table::sendSlotsToServer(Slot *slot, int newSize, bool isNewKey) {
        bool attemptedToSendToServerTmp = attemptedToSendToServer;
        attemptedToSendToServer = true;
 
@@ -1096,13 +1096,13 @@ ThreeTuple<bool, bool, Array<Slot *> *> *Table::sendSlotsToServer(Slot *slot, in
                }
        }
 
-       return new ThreeTuple<bool, bool, Array<Slot *> *>(inserted, lastTryInserted, array);
+       return ThreeTuple<bool, bool, Array<Slot *> *>(inserted, lastTryInserted, array);
 }
 
 /**
  * Returns false if a resize was needed
  */
-ThreeTuple<bool, int32_t, bool> *Table::fillSlot(Slot *slot, bool resize, NewKey *newKeyEntry) {
+ThreeTuple<bool, int32_t, bool> Table::fillSlot(Slot *slot, bool resize, NewKey *newKeyEntry) {
 
 
        int newSize = 0;
@@ -1130,7 +1130,7 @@ ThreeTuple<bool, int32_t, bool> *Table::fillSlot(Slot *slot, bool resize, NewKey
 
        if (needsResize && !resize) {
                // We need to resize but we are not resizing so return false
-               return new ThreeTuple<bool, int32_t, bool>(true, NULL, NULL);
+               return ThreeTuple<bool, int32_t, bool>(true, NULL, NULL);
        }
 
        bool inserted = false;
@@ -1216,7 +1216,7 @@ ThreeTuple<bool, int32_t, bool> *Table::fillSlot(Slot *slot, bool resize, NewKey
        // Fill the remainder of the slot with rescue data
        doOptionalRescue(slot, seenLiveSlot, currentRescueSequenceNumber, resize);
 
-       return new ThreeTuple<bool, int32_t, bool>(false, newSize, inserted);
+       return ThreeTuple<bool, int32_t, bool>(false, newSize, inserted);
 }
 
 void Table::doRejectedMessages(Slot *s) {
@@ -1298,14 +1298,14 @@ ThreeTuple<bool, bool, int64_t> Table::doMandatoryResuce(Slot *slot, bool resize
                        } else if (currentSequenceNumber == firstIfFull) {
                                //if there's no space but the entry is about to fall off the queue
                                System->out->println("B");      //?
-                               return new ThreeTuple<bool, bool, int64_t>(true, seenLiveSlot, currentSequenceNumber);
+                               return ThreeTuple<bool, bool, int64_t>(true, seenLiveSlot, currentSequenceNumber);
 
                        }
                }
        }
 
        // Did not resize
-       return new ThreeTuple<bool, bool, int64_t>(false, seenLiveSlot, currentSequenceNumber);
+       return ThreeTuple<bool, bool, int64_t>(false, seenLiveSlot, currentSequenceNumber);
 }
 
 void Table::doOptionalRescue(Slot *s, bool seenliveslot, int64_t seqn, bool resize) {
@@ -1518,10 +1518,10 @@ void Table::processNewTransactionParts() {
 
        // Iterate through all the machine Ids that we received new parts for
        for (int64_t machineId : newTransactionParts->keySet()) {
-               Hashtable<Pair<int64_t int32_t> *, TransactionPart *> *parts = newTransactionParts->get(machineId);
+               Hashtable<Pair<int64_t int32_t>, TransactionPart *> *parts = newTransactionParts->get(machineId);
 
                // Iterate through all the parts for that machine Id
-               for (Pair<int64_t, int32_t> *partId : parts->keySet()) {
+               for (Pair<int64_t, int32_t> partId : parts->keySet()) {
                        TransactionPart *part = parts->get(partId);
 
                        int64_t lastTransactionNumber = lastArbitratedTransactionNumberByArbitratorTable->get(part->getArbitratorId());
@@ -1684,13 +1684,13 @@ Pair<bool, bool> Table::arbitrateOnLocalTransaction(Transaction *transaction) {
 
        // Check if this machine arbitrates for this transaction if not then we cant arbitrate this transaction
        if (transaction->getArbitrator() != localMachineId) {
-               return new Pair<bool, bool>(false, false);
+               return Pair<bool, bool>(false, false);
        }
 
        if (!transaction->isComplete()) {
                // Will arbitrate in incorrect order if we continue so just break
                // Most likely this
-               return new Pair<bool, bool>(false, false);
+               return Pair<bool, bool>(false, false);
        }
 
        if (transaction->getMachineId() != localMachineId) {
@@ -1698,7 +1698,7 @@ Pair<bool, bool> Table::arbitrateOnLocalTransaction(Transaction *transaction) {
                if (lastTransactionSeenFromMachineFromServer->get(transaction->getMachineId()) != NULL) {
                        if (lastTransactionSeenFromMachineFromServer->get(transaction->getMachineId()) > transaction->getClientLocalSequenceNumber()) {
                                // We've have already seen this from the server
-                               return new Pair<bool, bool>(false, false);
+                               return Pair<bool, bool>(false, false);
                        }
                }
        }
@@ -1742,7 +1742,7 @@ Pair<bool, bool> Table::arbitrateOnLocalTransaction(Transaction *transaction) {
                }
 
                updateLiveStateFromLocal();
-               return new Pair<bool, bool>(true, true);
+               return Pair<bool, bool>(true, true);
        } else {
 
                if (transaction->getMachineId() == localMachineId) {
@@ -1782,7 +1782,7 @@ Pair<bool, bool> Table::arbitrateOnLocalTransaction(Transaction *transaction) {
                }
 
                updateLiveStateFromLocal();
-               return new Pair<bool, bool>(true, false);
+               return Pair<bool, bool>(true, false);
        }
 }
 
@@ -1889,10 +1889,10 @@ bool Table::updateCommittedTable() {
 
        // Iterate through all the machine Ids that we received new parts for
        for (int64_t machineId : newCommitParts->keySet()) {
-               Hashtable<Pair<int64_t, int32_t> *, CommitPart *> *parts = newCommitParts->get(machineId);
+               Hashtable<Pair<int64_t, int32_t>, CommitPart *> *parts = newCommitParts->get(machineId);
 
                // Iterate through all the parts for that machine Id
-               for (Pair<int64_t, int32_t> *partId : parts->keySet()) {
+               for (Pair<int64_t, int32_t> partId : parts->keySet()) {
                        CommitPart *part = parts->get(partId);
 
                        // Get the transaction object for that sequence number
@@ -2323,7 +2323,7 @@ void Table::processEntry(RejectedMessage *entry, SlotIndexer *indexer) {
 
        // Create a list of clients to watch until they see this rejected message entry->
        Hashset<int64_t> *deviceWatchSet = new Hashset<int64_t>();
-       for (Map->Entry<int64_t, Pair<int64_t, Liveness *> *> *lastMessageEntry : lastMessageTable->entrySet()) {
+       for (Map->Entry<int64_t, Pair<int64_t, Liveness *> > *lastMessageEntry : lastMessageTable->entrySet()) {
 
                // Machine ID for the last message entry
                int64_t lastMessageEntryMachineId = lastMessageEntry->getKey();
@@ -2334,7 +2334,7 @@ void Table::processEntry(RejectedMessage *entry, SlotIndexer *indexer) {
                        continue;
                }
 
-               Pair<int64_t, Liveness *> *lastMessageValue = lastMessageEntry->getValue();
+               Pair<int64_t, Liveness *> lastMessageValue = lastMessageEntry->getValue();
                int64_t entrySequenceNumber = lastMessageValue->getFirst();
 
                if (entrySequenceNumber < seq) {
@@ -2409,7 +2409,7 @@ void Table::processEntry(Abort *entry) {
 
 
        // Set dead a transaction if we can
-       Transaction *transactionToSetDead = liveTransactionByTransactionIdTable->remove(new Pair<int64_t, int64_t>(entry->getTransactionMachineId(), entry->getTransactionClientLocalSequenceNumber()));
+       Transaction *transactionToSetDead = liveTransactionByTransactionIdTable->remove(Pair<int64_t, int64_t>(entry->getTransactionMachineId(), entry->getTransactionClientLocalSequenceNumber()));
        if (transactionToSetDead != NULL) {
                liveTransactionBySequenceNumberTable->remove(transactionToSetDead->getSequenceNumber());
        }
@@ -2438,11 +2438,11 @@ void Table::processEntry(TransactionPart *entry) {
        }
 
        // This part is still alive
-       Hashtable<Pair<int64_t, int32_t> *, TransactionPart *> *transactionPart = newTransactionParts->get(entry->getMachineId());
+       Hashtable<Pair<int64_t, int32_t>, TransactionPart *> *transactionPart = newTransactionParts->get(entry->getMachineId());
 
        if (transactionPart == NULL) {
                // Dont have a table for this machine Id yet so make one
-               transactionPart = new Hashtable<Pair<int64_t, int32_t> *, TransactionPart *>();
+               transactionPart = new Hashtable<Pair<int64_t, int32_t>, TransactionPart *>();
                newTransactionParts->put(entry->getMachineId(), transactionPart);
        }
 
@@ -2470,11 +2470,11 @@ void Table::processEntry(CommitPart *entry) {
 
 
 
-       Hashtable<Pair<int64_t, int32_t> *, CommitPart *> *commitPart = newCommitParts->get(entry->getMachineId());
+       Hashtable<Pair<int64_t, int32_t>, CommitPart *> *commitPart = newCommitParts->get(entry->getMachineId());
 
        if (commitPart == NULL) {
                // Don't have a table for this machine Id yet so make one
-               commitPart = new Hashtable<Pair<int64_t, int32_t> *, CommitPart *>();
+               commitPart = new Hashtable<Pair<int64_t, int32_t>, CommitPart *>();
                newCommitParts->put(entry->getMachineId(), commitPart);
        }
 
@@ -2520,7 +2520,7 @@ void Table::updateLastMessage(int64_t machineId, int64_t seqNum, Liveness *liven
        }
 
        // Set dead the abort
-       for (Iterator<Map->Entry<Pair<int64_t, int64_t> *, Abort *> > i = liveAbortTable->entrySet()->iterator(); i->hasNext();) {
+       for (Iterator<Map->Entry<Pair<int64_t, int64_t>, Abort *> > i = liveAbortTable->entrySet()->iterator(); i->hasNext();) {
                Abort *abort = i->next()->getValue();
 
                if ((abort->getTransactionMachineId() == machineId) && (abort->getSequenceNumber() <= seqNum)) {
@@ -2547,7 +2547,7 @@ void Table::updateLastMessage(int64_t machineId, int64_t seqNum, Liveness *liven
        }
 
        // Get the old last message for this device
-       Pair<int64_t, Liveness *> *lastMessageEntry = lastMessageTable->put(machineId, new Pair<int64_t, Liveness *>(seqNum, liveness));
+       Pair<int64_t, Liveness *> lastMessageEntry = lastMessageTable->put(machineId, Pair<int64_t, Liveness *>(seqNum, liveness));
        if (lastMessageEntry == NULL) {
                // If no last message then there is nothing else to process
                return;
index 3f522144e983df2ed461114f7ec91ab5df05fc5b..a5ea0dc9b3c4095f1c49bca3c4c36d3ed20b37e2 100644 (file)
@@ -62,15 +62,15 @@ private:
        Hashtable<IoTString *, KeyValue *> *speculatedKeyValueTable;    // Table of speculated key value pairs, if there is a speculative value
        Hashtable<IoTString *, KeyValue *> *pendingTransactionSpeculatedKeyValueTable;  // Table of speculated key value pairs, if there is a speculative value from the pending transactions
        Hashtable<IoTString *, NewKey *> *liveNewKeyTable;      // Table of live new keys
-       Hashtable<int64_t, Pair<int64_t, Liveness *> *> *lastMessageTable;      // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
+       Hashtable<int64_t, Pair<int64_t, Liveness *> > *lastMessageTable;       // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
        Hashtable<int64_t, Hashset<RejectedMessage *> *> *rejectedMessageWatchVectorTable;      // Table of machine Ids and the set of rejected messages they have not seen yet
        Hashtable<IoTString *, int64_t> *arbitratorTable;// Table of keys and their arbitrators
-       Hashtable<Pair<int64_t, int64_t> *, Abort *> *liveAbortTable;// Table live abort messages
-       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t> *, TransactionPart *> *> *newTransactionParts;      // transaction parts that are seen in this latest round of slots from the server
-       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t> *, CommitPart *> *> *newCommitParts;        // commit parts that are seen in this latest round of slots from the server
+       Hashtable<Pair<int64_t, int64_t>, Abort *> *liveAbortTable;// Table live abort messages
+       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, TransactionPart *> *> *newTransactionParts;        // transaction parts that are seen in this latest round of slots from the server
+       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, CommitPart *> *> *newCommitParts;  // commit parts that are seen in this latest round of slots from the server
        Hashtable<int64_t, int64_t> *lastArbitratedTransactionNumberByArbitratorTable;  // Last transaction sequence number that an arbitrator arbitrated on
        Hashtable<int64_t, Transaction *> *liveTransactionBySequenceNumberTable;        // live transaction grouped by the sequence number
-       Hashtable<Pair<int64_t, int64_t> *, Transaction *> *liveTransactionByTransactionIdTable;        // live transaction grouped by the transaction ID
+       Hashtable<Pair<int64_t, int64_t>, Transaction *> *liveTransactionByTransactionIdTable;  // live transaction grouped by the transaction ID
        Hashtable<int64_t, Hashtable<int64_t, Commit *> > *liveCommitsTable;
        Hashtable<IoTString *, Commit *> *liveCommitsByKeyTable;
        Hashtable<int64_t, int64_t> *lastCommitSeenSequenceNumberByArbitratorTable;
@@ -81,7 +81,7 @@ private:
        Hashtable<Transaction *, Vector<int32_t> *> *transactionPartsSent;
        Hashtable<int64_t, TransactionStatus *> *outstandingTransactionStatus;
        Hashtable<int64_t, Abort *> *liveAbortsGeneratedByLocal;
-       Hashset<Pair<int64_t, int64_t> *> *offlineTransactionsCommittedAndAtServer;
+       Hashset<Pair<int64_t, int64_t> > *offlineTransactionsCommittedAndAtServer;
        Hashtable<int64_t, Pair<IoTString *, int32_t> > *localCommunicationTable;
        Hashtable<int64_t, int64_t> *lastTransactionSeenFromMachineFromServer;
        Hashtable<int64_t, int64_t> *lastArbitrationDataLocalSequenceNumberSeenFromArbitrator;
@@ -97,11 +97,11 @@ private:
        bool sendToServer(NewKey *newKey);
        bool updateFromLocal(int64_t machineId);
        Pair<bool, bool> sendTransactionToLocal(Transaction *transaction);
-       ThreeTuple<bool, bool, Array<Slot *> *> *sendSlotsToServer(Slot *slot, int newSize, bool isNewKey);
+       ThreeTuple<bool, bool, Array<Slot *> *> sendSlotsToServer(Slot *slot, int newSize, bool isNewKey);
        /**
         * Returns false if a resize was needed
         */
-       ThreeTuple<bool, int32_t, bool> *fillSlot(Slot *slot, bool resize, NewKey *newKeyEntry);
+       ThreeTuple<bool, int32_t, bool> fillSlot(Slot *slot, bool resize, NewKey *newKeyEntry);
        void doRejectedMessages(Slot *s);
 
        ThreeTuple<bool, bool, int64_t> doMandatoryResuce(Slot *slot, bool resize);
index b5b8e5074ad6a5b5a682a41dd933d30264bf24f3..a3083ee61ed99a69cd68560f6730a5860e7b1b4e 100644 (file)
@@ -183,7 +183,7 @@ bool Transaction::isComplete() {
        return fldisComplete;
 }
 
-Pair<int64_t, int64_t> *Transaction::getId() {
+Pair<int64_t, int64_t> Transaction::getId() {
        return transactionId;
 }
 
index f18bd70f6e0db72add125e1370a3f7e94ccaff7e..4be64ff0fd15a39dc44d509405b34d220316eaae 100644 (file)
@@ -17,7 +17,7 @@ private:
        int64_t clientLocalSequenceNumber;
        int64_t arbitratorId;
        int64_t machineId;
-       Pair<int64_t, int64_t> *transactionId;
+       Pair<int64_t, int64_t> transactionId;
        int nextPartToSend;
        bool flddidSendAPartToServer;
        TransactionStatus *transactionStatus;
@@ -49,7 +49,7 @@ public:
        int64_t getMachineId();
        int64_t getArbitrator();
        bool isComplete();
-       Pair<int64_t, int64_t> *getId();
+       Pair<int64_t, int64_t> getId();
        void setDead();
        TransactionPart *getPart(int32_t index);
        bool evaluateGuard(Hashtable<IoTString *, KeyValue *> *committedKeyValueTable, Hashtable<IoTString *, KeyValue *> *speculatedKeyValueTable, Hashtable<IoTString *, KeyValue *> *pendingTransactionSpeculatedKeyValueTable);
index fef588e529564e434c95ce9cddc9304da3ed3d99..86393d0e4d90da4e7b54cb88c11d1fb340741e93 100644 (file)
@@ -12,7 +12,7 @@ void TransactionPart::setSlot(Slot *s) {
        parentslot = s;
 }
 
-Pair<int64_t, int64_t> *TransactionPart::getTransactionId() {
+Pair<int64_t, int64_t> TransactionPart::getTransactionId() {
        return transactionId;
 }
 
@@ -20,7 +20,7 @@ int64_t TransactionPart::getArbitratorId() {
        return arbitratorId;
 }
 
-Pair<int64_t, int32_t> *TransactionPart::getPartId() {
+Pair<int64_t, int32_t> TransactionPart::getPartId() {
        return partId;
 }
 
index 51f8f888f81e2f491b4629277de15496c17d6373..f832c30adee4471daa4c3f6b230c93a9edfc63e7 100644 (file)
@@ -16,8 +16,8 @@ private:
        int32_t partNumber;     // Parts position in the
        bool fldisLastPart;
 
-       Pair<int64_t, int64_t> *transactionId;
-       Pair<int64_t, int32_t> *partId;
+       Pair<int64_t, int64_t> transactionId;
+       Pair<int64_t, int32_t> partId;
 
        Array<char> *data;
 
@@ -29,16 +29,16 @@ public:
                clientLocalSequenceNumber(_clientLocalSequenceNumber),
                partNumber(_partNumber),
                fldisLastPart(_isLastPart),
-               transactionId(new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber)),
-               partId(new Pair<int64_t, int32_t>(clientLocalSequenceNumber, partNumber)),
+               transactionId(Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber)),
+               partId(Pair<int64_t, int32_t>(clientLocalSequenceNumber, partNumber)),
                data(_data) {
        }
 
        int getSize();
        void setSlot(Slot *s);
-       Pair<int64_t, int64_t> *getTransactionId();
+       Pair<int64_t, int64_t> getTransactionId();
        int64_t getArbitratorId();
-       Pair<int64_t, int32_t> *getPartId();
+       Pair<int64_t, int32_t> getPartId();
        int getPartNumber();
        int getDataSize();
        Array<char> *getData();