edits
authorbdemsky <bdemsky@uci.edu>
Fri, 19 Jan 2018 02:23:58 +0000 (18:23 -0800)
committerbdemsky <bdemsky@uci.edu>
Fri, 19 Jan 2018 02:23:58 +0000 (18:23 -0800)
version2/src/C/ArbitrationRound.cc
version2/src/C/Commit.cc
version2/src/C/CommitPart.cc
version2/src/C/CommitPart.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
version2/src/C/hashtable.h

index f7886711cd4c819f11fd34c941535f6b0caabbe1..2e2105d4c91300832c611e68d5558cf8a24c75be 100644 (file)
@@ -27,11 +27,11 @@ void ArbitrationRound::generateParts() {
   }
 }
 
   }
 }
 
-List<Entry *> * ArbitrationRound::getParts() {
+Vector<Entry *> * ArbitrationRound::getParts() {
   return parts;
 }
 
   return parts;
 }
 
-void ArbitrationRound::removeParts(List<Entry *> * removeParts) {
+void ArbitrationRound::removeParts(Vector<Entry *> * removeParts) {
   parts->removeAll(removeParts);
   didSendPart = true;
 }
   parts->removeAll(removeParts);
   didSendPart = true;
 }
index 5c616920726d5a8fbedd163ce5e9b517935ec405..a5b952d93b710249429768f036904683e0825c65 100644 (file)
@@ -41,7 +41,7 @@ void Commit::addPartDecode(CommitPart newPart) {
                // Set dead the old one since the new one is a rescued version of this part
                previoslySeenPart.setDead();
        } else if (newPart.isLastPart()) {
                // 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++) {
                hasLastPart = true;
                
                for (int i = 0; i < newPart.getPartNumber(); i++) {
@@ -81,7 +81,7 @@ void Commit::addPartDecode(CommitPart newPart) {
         return transactionSequenceNumber;
     }
 
         return transactionSequenceNumber;
     }
 
-    Hashtable<Integer, CommitPart> getParts() {
+    Hashtable<int32_t, CommitPart> getParts() {
         return parts;
     }
 
         return parts;
     }
 
@@ -116,7 +116,7 @@ int32_t getNumberOfParts() {
         isDead = true;
 
         // Make all the parts of this transaction dead
         isDead = true;
 
         // Make all the parts of this transaction dead
-        for (Integer partNumber : parts.keySet()) {
+        for (int32_t partNumber : parts.keySet()) {
             CommitPart part = parts.get(partNumber);
             part.setDead();
         }
             CommitPart part = parts.get(partNumber);
             part.setDead();
         }
index d17f3346cc8ef500ded35a9e50fe92a0fb4d02fe..4de55c925879d0c1d52f2025149eb34aa062a620 100644 (file)
@@ -16,7 +16,7 @@ class CommitPart extends Entry{
     Boolean isLastPart = false;
     char[] data = NULL;
 
     Boolean isLastPart = false;
     char[] data = NULL;
 
-    Pair<Long, Integer> partId = NULL;
+    Pair<int64_t int32_t> partId = NULL;
     Pair<int64_t, int64_t> commitId = NULL;
 
 
     Pair<int64_t, int64_t> commitId = NULL;
 
 
@@ -29,7 +29,7 @@ class CommitPart extends Entry{
         isLastPart = _isLastPart;
         data = _data;
 
         isLastPart = _isLastPart;
         data = _data;
 
-        partId = new Pair<Long, Integer>(sequenceNumber, partNumber);
+        partId = new Pair<int64_t int32_t>(sequenceNumber, partNumber);
         commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
         commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
@@ -56,7 +56,7 @@ class CommitPart extends Entry{
         return data;
     }
 
         return data;
     }
 
-    Pair<Long, Integer> getPartId() {
+    Pair<int64_t int32_t> getPartId() {
         return partId;
     }
 
         return partId;
     }
 
index 9a5772f305f2a6c755342181a91fb65781c4e819..e121aad55f1067ec95d5ab864820e21a8615fbd9 100644 (file)
@@ -16,7 +16,7 @@ class CommitPart extends Entry{
     private Boolean isLastPart = false;
     private char[] data = NULL;
 
     private Boolean isLastPart = false;
     private char[] data = NULL;
 
-    private Pair<Long, Integer> partId = NULL;
+    private Pair<int64_t int32_t> partId = NULL;
     private Pair<int64_t, int64_t> commitId = NULL;
 
 
     private Pair<int64_t, int64_t> commitId = NULL;
 
 
@@ -29,7 +29,7 @@ class CommitPart extends Entry{
         isLastPart = _isLastPart;
         data = _data;
 
         isLastPart = _isLastPart;
         data = _data;
 
-        partId = new Pair<Long, Integer>(sequenceNumber, partNumber);
+        partId = new Pair<int64_t int32_t>(sequenceNumber, partNumber);
         commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
         commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
@@ -56,7 +56,7 @@ class CommitPart extends Entry{
         return data;
     }
 
         return data;
     }
 
-    public Pair<Long, Integer> getPartId() {
+    public Pair<int64_t int32_t> getPartId() {
         return partId;
     }
 
         return partId;
     }
 
index 0a70459dfb16688895694441cac3c8739df9e637..508609e6c138a726c306f72c023cf0c9ace7e530 100644 (file)
@@ -48,8 +48,8 @@ final class Table {
        Slot lastSlotAttemptedToSend = NULL;
        bool lastIsNewKey = false;
        int lastNewSize = 0;
        Slot lastSlotAttemptedToSend = NULL;
        bool lastIsNewKey = false;
        int lastNewSize = 0;
-       Hashtable<Transaction, List<Integer>> lastTransactionPartsSent = NULL;
-       List<Entry> lastPendingSendArbitrationEntriesToDelete = NULL;
+       Hashtable<Transaction, Vector<int32_t>> lastTransactionPartsSent = NULL;
+       Vector<Entry> lastPendingSendArbitrationEntriesToDelete = NULL;
        NewKey lastNewKey = NULL;
 
 
        NewKey lastNewKey = NULL;
 
 
@@ -58,27 +58,27 @@ final class Table {
        Hashtable<IoTString, KeyValue> speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value
        Hashtable<IoTString, KeyValue> pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions
        Hashtable<IoTString, NewKey> liveNewKeyTable = NULL; // Table of live new keys
        Hashtable<IoTString, KeyValue> speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value
        Hashtable<IoTString, KeyValue> pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions
        Hashtable<IoTString, NewKey> liveNewKeyTable = NULL; // Table of live new keys
-       Hashtable<Long, Pair<Long, Liveness>> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
-       Hashtable<Long, HashSet<RejectedMessage>> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
+       Hashtable<int64_t Pair<int64_t Liveness>> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
+       Hashtable<int64_t HashSet<RejectedMessage>> rejectedMessageWatchVectorTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
        Hashtable<IoTString, Long> arbitratorTable = NULL; // Table of keys and their arbitrators
        Hashtable<Pair<int64_t, int64_t>, Abort> liveAbortTable = NULL; // Table live abort messages
        Hashtable<IoTString, Long> arbitratorTable = NULL; // Table of keys and their arbitrators
        Hashtable<Pair<int64_t, int64_t>, Abort> liveAbortTable = NULL; // Table live abort messages
-       Hashtable<Long, Hashtable<Pair<Long, Integer>, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server
-       Hashtable<Long, Hashtable<Pair<Long, Integer>, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server
+       Hashtable<int64_t Hashtable<Pair<int64_t int32_t>, TransactionPart>> newTransactionParts = NULL; // 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 = NULL; // commit parts that are seen in this latest round of slots from the server
        Hashtable<int64_t, int64_t> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
        Hashtable<int64_t, int64_t> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
-       Hashtable<Long, Transaction> liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number
+       Hashtable<int64_t Transaction> liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number
        Hashtable<Pair<int64_t, int64_t>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
        Hashtable<Pair<int64_t, int64_t>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
-       Hashtable<Long, Hashtable<Long, Commit>> liveCommitsTable = NULL;
+       Hashtable<int64_t Hashtable<int64_t Commit>> liveCommitsTable = NULL;
        Hashtable<IoTString, Commit> liveCommitsByKeyTable = NULL;
        Hashtable<int64_t, int64_t> lastCommitSeenSequenceNumberByArbitratorTable = NULL;
        Hashtable<IoTString, Commit> liveCommitsByKeyTable = NULL;
        Hashtable<int64_t, int64_t> lastCommitSeenSequenceNumberByArbitratorTable = NULL;
-       Vector<Long> rejectedSlotList = NULL; // List of rejected slots that have yet to be sent to the server
-       List<Transaction> pendingTransactionQueue = NULL;
-       List<ArbitrationRound> pendingSendArbitrationRounds = NULL;
-       List<Entry> pendingSendArbitrationEntriesToDelete = NULL;
-       Hashtable<Transaction, List<Integer>> transactionPartsSent = NULL;
-       Hashtable<Long, TransactionStatus> outstandingTransactionStatus = NULL;
-       Hashtable<Long, Abort> liveAbortsGeneratedByLocal = NULL;
+       Vector<Long> rejectedSlotVector = NULL; // Vector of rejected slots that have yet to be sent to the server
+       Vector<Transaction> pendingTransactionQueue = NULL;
+       Vector<ArbitrationRound> pendingSendArbitrationRounds = NULL;
+       Vector<Entry> pendingSendArbitrationEntriesToDelete = NULL;
+       Hashtable<Transaction, Vector<int32_t>> transactionPartsSent = NULL;
+       Hashtable<int64_t TransactionStatus> outstandingTransactionStatus = NULL;
+       Hashtable<int64_t Abort> liveAbortsGeneratedByLocal = NULL;
        Set<Pair<int64_t, int64_t>> offlineTransactionsCommittedAndAtServer = NULL;
        Set<Pair<int64_t, int64_t>> offlineTransactionsCommittedAndAtServer = NULL;
-       Hashtable<Long, Pair<String, Integer>> localCommunicationTable = NULL;
+       Hashtable<int64_t Pair<String, int32_t>> localCommunicationTable = NULL;
        Hashtable<int64_t, int64_t> lastTransactionSeenFromMachineFromServer = NULL;
        Hashtable<int64_t, int64_t> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
 
        Hashtable<int64_t, int64_t> lastTransactionSeenFromMachineFromServer = NULL;
        Hashtable<int64_t, int64_t> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
 
@@ -114,28 +114,28 @@ final class Table {
                speculatedKeyValueTable = new Hashtable<IoTString, KeyValue>();
                pendingTransactionSpeculatedKeyValueTable = new Hashtable<IoTString, KeyValue>();
                liveNewKeyTable = new Hashtable<IoTString, NewKey>();
                speculatedKeyValueTable = new Hashtable<IoTString, KeyValue>();
                pendingTransactionSpeculatedKeyValueTable = new Hashtable<IoTString, KeyValue>();
                liveNewKeyTable = new Hashtable<IoTString, NewKey>();
-               lastMessageTable = new Hashtable<Long, Pair<Long, Liveness>>();
-               rejectedMessageWatchListTable = new Hashtable<Long, HashSet<RejectedMessage>>();
+               lastMessageTable = new Hashtable<int64_t Pair<int64_t Liveness>>();
+               rejectedMessageWatchVectorTable = new Hashtable<int64_t HashSet<RejectedMessage>>();
                arbitratorTable = new Hashtable<IoTString, Long>();
                liveAbortTable = new Hashtable<Pair<int64_t, int64_t>, Abort>();
                arbitratorTable = new Hashtable<IoTString, Long>();
                liveAbortTable = new Hashtable<Pair<int64_t, int64_t>, Abort>();
-               newTransactionParts = new Hashtable<Long, Hashtable<Pair<Long, Integer>, TransactionPart>>();
-               newCommitParts = new Hashtable<Long, Hashtable<Pair<Long, Integer>, CommitPart>>();
+               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>();
                lastArbitratedTransactionNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
-               liveTransactionBySequenceNumberTable = new Hashtable<Long, Transaction>();
+               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<Long, Hashtable<Long, Commit>>();
+               liveCommitsTable = new Hashtable<int64_t Hashtable<int64_t Commit>>();
                liveCommitsByKeyTable = new Hashtable<IoTString, Commit>();
                lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
                liveCommitsByKeyTable = new Hashtable<IoTString, Commit>();
                lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
-               rejectedSlotList = new Vector<Long>();
-               pendingTransactionQueue = new ArrayList<Transaction>();
-               pendingSendArbitrationEntriesToDelete = new ArrayList<Entry>();
-               transactionPartsSent = new Hashtable<Transaction, List<Integer>>();
-               outstandingTransactionStatus = new Hashtable<Long, TransactionStatus>();
-               liveAbortsGeneratedByLocal = new Hashtable<Long, Abort>();
+               rejectedSlotVector = new Vector<Long>();
+               pendingTransactionQueue = new Vector<Transaction>();
+               pendingSendArbitrationEntriesToDelete = new Vector<Entry>();
+               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<Long, Pair<String, Integer>>();
+               localCommunicationTable = new Hashtable<int64_t Pair<String, int32_t>>();
                lastTransactionSeenFromMachineFromServer = new Hashtable<int64_t, int64_t>();
                lastTransactionSeenFromMachineFromServer = new Hashtable<int64_t, int64_t>();
-               pendingSendArbitrationRounds = new ArrayList<ArbitrationRound>();
+               pendingSendArbitrationRounds = new Vector<ArbitrationRound>();
                lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new Hashtable<int64_t, int64_t>();
 
 
                lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new Hashtable<int64_t, int64_t>();
 
 
@@ -276,7 +276,7 @@ final class Table {
        // }
 
        synchronized void addLocalCommunication(int64_t arbitrator, String hostName, int portNumber) {
        // }
 
        synchronized void addLocalCommunication(int64_t arbitrator, String hostName, int portNumber) {
-               localCommunicationTable.put(arbitrator, new Pair<String, Integer>(hostName, portNumber));
+               localCommunicationTable.put(arbitrator, new Pair<String, int32_t>(hostName, portNumber));
        }
 
        synchronized Long getArbitrator(IoTString key) {
        }
 
        synchronized Long getArbitrator(IoTString key) {
@@ -732,7 +732,7 @@ final class Table {
                                localSequenceNumber++;
 
                                // Try to fill the slot with data
                                localSequenceNumber++;
 
                                // Try to fill the slot with data
-                               ThreeTuple<Boolean, Integer, Boolean> fillSlotsReturn = fillSlot(slot, false, newKey);
+                               ThreeTuple<Boolean, int32_t, Boolean> fillSlotsReturn = fillSlot(slot, false, newKey);
                                bool needsResize = fillSlotsReturn.getFirst();
                                int newSize = fillSlotsReturn.getSecond();
                                Boolean insertedNewKey = fillSlotsReturn.getThird();
                                bool needsResize = fillSlotsReturn.getFirst();
                                int newSize = fillSlotsReturn.getSecond();
                                Boolean insertedNewKey = fillSlotsReturn.getThird();
@@ -761,8 +761,8 @@ final class Table {
                                lastInsertedNewKey = insertedNewKey;
                                lastNewSize = newSize;
                                lastNewKey = newKey;
                                lastInsertedNewKey = insertedNewKey;
                                lastNewSize = newSize;
                                lastNewKey = newKey;
-                               lastTransactionPartsSent = new Hashtable<Transaction, List<Integer>>(transactionPartsSent);
-                               lastPendingSendArbitrationEntriesToDelete = new ArrayList<Entry>(pendingSendArbitrationEntriesToDelete);
+                               lastTransactionPartsSent = new Hashtable<Transaction, Vector<int32_t>>(transactionPartsSent);
+                               lastPendingSendArbitrationEntriesToDelete = new Vector<Entry>(pendingSendArbitrationEntriesToDelete);
 
 
                                ThreeTuple<Boolean, Boolean, Slot[]> sendSlotsReturn = sendSlotsToServer(slot, newSize, newKey != NULL);
 
 
                                ThreeTuple<Boolean, Boolean, Slot[]> sendSlotsReturn = sendSlotsToServer(slot, newSize, newKey != NULL);
@@ -880,8 +880,8 @@ final class Table {
 
 
                                // if (!fromRetry) {
 
 
                                // if (!fromRetry) {
-                               //      lastTransactionPartsSent = new Hashtable<Transaction, List<Integer>>(transactionPartsSent);
-                               //      lastPendingSendArbitrationEntriesToDelete = new ArrayList<Entry>(pendingSendArbitrationEntriesToDelete);
+                               //      lastTransactionPartsSent = new Hashtable<Transaction, Vector<int32_t>>(transactionPartsSent);
+                               //      lastPendingSendArbitrationEntriesToDelete = new Vector<Entry>(pendingSendArbitrationEntriesToDelete);
                                // }
 
                                // Nothing was able to be sent to the server so just clear these data structures
                                // }
 
                                // Nothing was able to be sent to the server so just clear these data structures
@@ -901,7 +901,7 @@ final class Table {
        }
 
        synchronized bool updateFromLocal(int64_t machineId) {
        }
 
        synchronized bool updateFromLocal(int64_t machineId) {
-               Pair<String, Integer> localCommunicationInformation = localCommunicationTable.get(machineId);
+               Pair<String, int32_t> localCommunicationInformation = localCommunicationTable.get(machineId);
                if (localCommunicationInformation == NULL) {
                        // Cant talk to that device locally so do nothing
                        return false;
                if (localCommunicationInformation == NULL) {
                        // Cant talk to that device locally so do nothing
                        return false;
@@ -954,7 +954,7 @@ final class Table {
        Pair<Boolean, Boolean> sendTransactionToLocal(Transaction transaction) {
 
                // Get the devices local communications
        Pair<Boolean, Boolean> sendTransactionToLocal(Transaction transaction) {
 
                // Get the devices local communications
-               Pair<String, Integer> localCommunicationInformation = localCommunicationTable.get(transaction.getArbitrator());
+               Pair<String, int32_t> localCommunicationInformation = localCommunicationTable.get(transaction.getArbitrator());
 
                if (localCommunicationInformation == NULL) {
                        // Cant talk to that device locally so do nothing
 
                if (localCommunicationInformation == NULL) {
                        // Cant talk to that device locally so do nothing
@@ -1073,10 +1073,10 @@ final class Table {
 
                // The data to send back
                int returnDataSize = 0;
 
                // The data to send back
                int returnDataSize = 0;
-               List<Entry> unseenArbitrations = new ArrayList<Entry>();
+               Vector<Entry> unseenArbitrations = new Vector<Entry>();
 
                // Get the aborts to send back
 
                // Get the aborts to send back
-               List<Long> abortLocalSequenceNumbers = new ArrayList<Long >(liveAbortsGeneratedByLocal.keySet());
+               Vector<Long> abortLocalSequenceNumbers = new Vector<Long >(liveAbortsGeneratedByLocal.keySet());
                Collections.sort(abortLocalSequenceNumbers);
                for (Long localSequenceNumber : abortLocalSequenceNumbers) {
                        if (localSequenceNumber <= lastArbitratedSequenceNumberSeen) {
                Collections.sort(abortLocalSequenceNumbers);
                for (Long localSequenceNumber : abortLocalSequenceNumbers) {
                        if (localSequenceNumber <= lastArbitratedSequenceNumberSeen) {
@@ -1089,9 +1089,9 @@ final class Table {
                }
 
                // Get the commits to send back
                }
 
                // Get the commits to send back
-               Hashtable<Long, Commit> commitForClientTable = liveCommitsTable.get(localMachineId);
+               Hashtable<int64_t Commit> commitForClientTable = liveCommitsTable.get(localMachineId);
                if (commitForClientTable != NULL) {
                if (commitForClientTable != NULL) {
-                       List<Long> commitLocalSequenceNumbers = new ArrayList<Long>(commitForClientTable.keySet());
+                       Vector<Long> commitLocalSequenceNumbers = new Vector<Long>(commitForClientTable.keySet());
                        Collections.sort(commitLocalSequenceNumbers);
 
                        for (Long localSequenceNumber : commitLocalSequenceNumbers) {
                        Collections.sort(commitLocalSequenceNumbers);
 
                        for (Long localSequenceNumber : commitLocalSequenceNumbers) {
@@ -1155,7 +1155,7 @@ final class Table {
                Slot[] array = cloud.putSlot(slot, newSize);
                if (array == NULL) {
                        array = new Slot[] {slot};
                Slot[] array = cloud.putSlot(slot, newSize);
                if (array == NULL) {
                        array = new Slot[] {slot};
-                       rejectedSlotList.clear();
+                       rejectedSlotVector.clear();
                        inserted = true;
                }       else {
                        if (array.length == 0) {
                        inserted = true;
                }       else {
                        if (array.length == 0) {
@@ -1193,13 +1193,13 @@ final class Table {
                                }
 
                                if (!isInserted) {
                                }
 
                                if (!isInserted) {
-                                       rejectedSlotList.add(slot.getSequenceNumber());
+                                       rejectedSlotVector.add(slot.getSequenceNumber());
                                        lastTryInserted = false;
                                } else {
                                        lastTryInserted = true;
                                }
                        } else {
                                        lastTryInserted = false;
                                } else {
                                        lastTryInserted = true;
                                }
                        } else {
-                               rejectedSlotList.add(slot.getSequenceNumber());
+                               rejectedSlotVector.add(slot.getSequenceNumber());
                                lastTryInserted = false;
                        }
                }
                                lastTryInserted = false;
                        }
                }
@@ -1210,7 +1210,7 @@ final class Table {
        /**
         * Returns false if a resize was needed
         */
        /**
         * Returns false if a resize was needed
         */
-       ThreeTuple<Boolean, Integer, Boolean> fillSlot(Slot slot, bool resize, NewKey newKeyEntry) {
+       ThreeTuple<Boolean, int32_t, Boolean> fillSlot(Slot slot, bool resize, NewKey newKeyEntry) {
 
 
                int newSize = 0;
 
 
                int newSize = 0;
@@ -1238,7 +1238,7 @@ final class Table {
 
                if (needsResize && !resize) {
                        // We need to resize but we are not resizing so return false
 
                if (needsResize && !resize) {
                        // We need to resize but we are not resizing so return false
-                       return new ThreeTuple<Boolean, Integer, Boolean>(true, NULL, NULL);
+                       return new ThreeTuple<Boolean, int32_t, Boolean>(true, NULL, NULL);
                }
 
                bool inserted = false;
                }
 
                bool inserted = false;
@@ -1258,7 +1258,7 @@ final class Table {
                for (ArbitrationRound round : pendingSendArbitrationRounds) {
                        bool isFull = false;
                        round.generateParts();
                for (ArbitrationRound round : pendingSendArbitrationRounds) {
                        bool isFull = false;
                        round.generateParts();
-                       List<Entry> parts = round.getParts();
+                       Vector<Entry> parts = round.getParts();
 
                        // Insert pending arbitration data
                        for (Entry arbitrationData : parts) {
 
                        // Insert pending arbitration data
                        for (Entry arbitrationData : parts) {
@@ -1308,9 +1308,9 @@ final class Table {
 
                                if (slot.hasSpace(part)) {
                                        slot.addEntry(part);
 
                                if (slot.hasSpace(part)) {
                                        slot.addEntry(part);
-                                       List<Integer> partsSent = transactionPartsSent.get(transaction);
+                                       Vector<int32_t> partsSent = transactionPartsSent.get(transaction);
                                        if (partsSent == NULL) {
                                        if (partsSent == NULL) {
-                                               partsSent = new ArrayList<Integer>();
+                                               partsSent = new Vector<int32_t>();
                                                transactionPartsSent.put(transaction, partsSent);
                                        }
                                        partsSent.add(part.getPartNumber());
                                                transactionPartsSent.put(transaction, partsSent);
                                        }
                                        partsSent.add(part.getPartNumber());
@@ -1324,26 +1324,26 @@ final class Table {
                // Fill the remainder of the slot with rescue data
                doOptionalRescue(slot, seenLiveSlot, currentRescueSequenceNumber, resize);
 
                // Fill the remainder of the slot with rescue data
                doOptionalRescue(slot, seenLiveSlot, currentRescueSequenceNumber, resize);
 
-               return new ThreeTuple<Boolean, Integer, Boolean>(false, newSize, inserted);
+               return new ThreeTuple<Boolean, int32_t, Boolean>(false, newSize, inserted);
        }
 
        void doRejectedMessages(Slot s) {
        }
 
        void doRejectedMessages(Slot s) {
-               if (! rejectedSlotList.isEmpty()) {
+               if (! rejectedSlotVector.isEmpty()) {
                        /* TODO: We should avoid generating a rejected message entry if
                         * there is already a sufficient entry in the queue (e.g.,
                         * equalsto value of true and same sequence number).  */
 
                        /* TODO: We should avoid generating a rejected message entry if
                         * there is already a sufficient entry in the queue (e.g.,
                         * equalsto value of true and same sequence number).  */
 
-                       int64_t old_seqn = rejectedSlotList.firstElement();
-                       if (rejectedSlotList.size() > REJECTED_THRESHOLD) {
-                               int64_t new_seqn = rejectedSlotList.lastElement();
+                       int64_t old_seqn = rejectedSlotVector.firstElement();
+                       if (rejectedSlotVector.size() > REJECTED_THRESHOLD) {
+                               int64_t new_seqn = rejectedSlotVector.lastElement();
                                RejectedMessage rm = new RejectedMessage(s, s.getSequenceNumber(), localMachineId, old_seqn, new_seqn, false);
                                s.addEntry(rm);
                        } else {
                                int64_t prev_seqn = -1;
                                int i = 0;
                                /* Go through list of missing messages */
                                RejectedMessage rm = new RejectedMessage(s, s.getSequenceNumber(), localMachineId, old_seqn, new_seqn, false);
                                s.addEntry(rm);
                        } else {
                                int64_t prev_seqn = -1;
                                int i = 0;
                                /* Go through list of missing messages */
-                               for (; i < rejectedSlotList.size(); i++) {
-                                       int64_t curr_seqn = rejectedSlotList.get(i);
+                               for (; i < rejectedSlotVector.size(); i++) {
+                                       int64_t curr_seqn = rejectedSlotVector.get(i);
                                        Slot s_msg = buffer.getSlot(curr_seqn);
                                        if (s_msg != NULL)
                                                break;
                                        Slot s_msg = buffer.getSlot(curr_seqn);
                                        if (s_msg != NULL)
                                                break;
@@ -1355,8 +1355,8 @@ final class Table {
                                        s.addEntry(rm);
                                }
                                /* Generate rejected message entries for present messages */
                                        s.addEntry(rm);
                                }
                                /* Generate rejected message entries for present messages */
-                               for (; i < rejectedSlotList.size(); i++) {
-                                       int64_t curr_seqn = rejectedSlotList.get(i);
+                               for (; i < rejectedSlotVector.size(); i++) {
+                                       int64_t curr_seqn = rejectedSlotVector.get(i);
                                        Slot s_msg = buffer.getSlot(curr_seqn);
                                        int64_t machineid = s_msg.getMachineID();
                                        RejectedMessage rm = new RejectedMessage(s, s.getSequenceNumber(), machineid, curr_seqn, curr_seqn, true);
                                        Slot s_msg = buffer.getSlot(curr_seqn);
                                        int64_t machineid = s_msg.getMachineID();
                                        RejectedMessage rm = new RejectedMessage(s, s.getSequenceNumber(), machineid, curr_seqn, curr_seqn, true);
@@ -1626,10 +1626,10 @@ final class Table {
 
                // Iterate through all the machine Ids that we received new parts for
                for (Long machineId : newTransactionParts.keySet()) {
 
                // Iterate through all the machine Ids that we received new parts for
                for (Long machineId : newTransactionParts.keySet()) {
-                       Hashtable<Pair<Long, Integer>, 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
 
                        // Iterate through all the parts for that machine Id
-                       for (Pair<Long, Integer> partId : parts.keySet()) {
+                       for (Pair<int64_t int32_t> partId : parts.keySet()) {
                                TransactionPart part = parts.get(partId);
 
                                Long lastTransactionNumber = lastArbitratedTransactionNumberByArbitratorTable.get(part.getArbitratorId());
                                TransactionPart part = parts.get(partId);
 
                                Long lastTransactionNumber = lastArbitratedTransactionNumberByArbitratorTable.get(part.getArbitratorId());
@@ -1671,7 +1671,7 @@ final class Table {
                }
 
                // Get the transaction sequence numbers and sort from oldest to newest
                }
 
                // Get the transaction sequence numbers and sort from oldest to newest
-               List<Long> transactionSequenceNumbers = new ArrayList<Long>(liveTransactionBySequenceNumberTable.keySet());
+               Vector<Long> transactionSequenceNumbers = new Vector<Long>(liveTransactionBySequenceNumberTable.keySet());
                Collections.sort(transactionSequenceNumbers);
 
                // Collection of key value pairs that are
                Collections.sort(transactionSequenceNumbers);
 
                // Collection of key value pairs that are
@@ -2000,18 +2000,18 @@ final class Table {
 
                // Iterate through all the machine Ids that we received new parts for
                for (Long machineId : newCommitParts.keySet()) {
 
                // Iterate through all the machine Ids that we received new parts for
                for (Long machineId : newCommitParts.keySet()) {
-                       Hashtable<Pair<Long, Integer>, 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
 
                        // Iterate through all the parts for that machine Id
-                       for (Pair<Long, Integer> 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
                                CommitPart part = parts.get(partId);
 
                                // Get the transaction object for that sequence number
-                               Hashtable<Long, Commit> commitForClientTable = liveCommitsTable.get(part.getMachineId());
+                               Hashtable<int64_t Commit> commitForClientTable = liveCommitsTable.get(part.getMachineId());
 
                                if (commitForClientTable == NULL) {
                                        // This is the first commit from this device
 
                                if (commitForClientTable == NULL) {
                                        // This is the first commit from this device
-                                       commitForClientTable = new Hashtable<Long, Commit>();
+                                       commitForClientTable = new Hashtable<int64_t Commit>();
                                        liveCommitsTable.put(part.getMachineId(), commitForClientTable);
                                }
 
                                        liveCommitsTable.put(part.getMachineId(), commitForClientTable);
                                }
 
@@ -2040,10 +2040,10 @@ final class Table {
                for (Long arbitratorId : liveCommitsTable.keySet()) {
 
                        // Get all the commits for a specific arbitrator
                for (Long arbitratorId : liveCommitsTable.keySet()) {
 
                        // Get all the commits for a specific arbitrator
-                       Hashtable<Long, Commit> commitForClientTable = liveCommitsTable.get(arbitratorId);
+                       Hashtable<int64_t Commit> commitForClientTable = liveCommitsTable.get(arbitratorId);
 
                        // Sort the commits in order
 
                        // Sort the commits in order
-                       List<Long> commitSequenceNumbers = new ArrayList<Long>(commitForClientTable.keySet());
+                       Vector<Long> commitSequenceNumbers = new Vector<Long>(commitForClientTable.keySet());
                        Collections.sort(commitSequenceNumbers);
 
                        // Get the last commit seen from this arbitrator
                        Collections.sort(commitSequenceNumbers);
 
                        // Get the last commit seen from this arbitrator
@@ -2170,7 +2170,7 @@ final class Table {
                }
 
                // Create a list of the transaction sequence numbers and sort them from oldest to newest
                }
 
                // Create a list of the transaction sequence numbers and sort them from oldest to newest
-               List<Long> transactionSequenceNumbersSorted = new ArrayList<Long>(liveTransactionBySequenceNumberTable.keySet());
+               Vector<Long> transactionSequenceNumbersSorted = new Vector<Long>(liveTransactionBySequenceNumberTable.keySet());
                Collections.sort(transactionSequenceNumbersSorted);
 
                bool hasGapInTransactionSequenceNumbers = transactionSequenceNumbersSorted.get(0) != oldestTransactionSequenceNumberSpeculatedOn;
                Collections.sort(transactionSequenceNumbersSorted);
 
                bool hasGapInTransactionSequenceNumbers = transactionSequenceNumbersSorted.get(0) != oldestTransactionSequenceNumberSpeculatedOn;
@@ -2282,7 +2282,7 @@ final class Table {
        void updateLiveTransactionsAndStatus() {
 
                // Go through each of the transactions
        void updateLiveTransactionsAndStatus() {
 
                // Go through each of the transactions
-               for (Iterator<Map.Entry<Long, Transaction>> iter = liveTransactionBySequenceNumberTable.entrySet().iterator(); iter.hasNext();) {
+               for (Iterator<Map.Entry<int64_t Transaction>> iter = liveTransactionBySequenceNumberTable.entrySet().iterator(); iter.hasNext();) {
                        Transaction transaction = iter.next().getValue();
 
                        // Check if the transaction is dead
                        Transaction transaction = iter.next().getValue();
 
                        // Check if the transaction is dead
@@ -2299,7 +2299,7 @@ final class Table {
                }
 
                // Go through each of the transactions
                }
 
                // Go through each of the transactions
-               for (Iterator<Map.Entry<Long, TransactionStatus>> iter = outstandingTransactionStatus.entrySet().iterator(); iter.hasNext();) {
+               for (Iterator<Map.Entry<int64_t TransactionStatus>> iter = outstandingTransactionStatus.entrySet().iterator(); iter.hasNext();) {
                        TransactionStatus status = iter.next().getValue();
 
                        // Check if the transaction is dead
                        TransactionStatus status = iter.next().getValue();
 
                        // Check if the transaction is dead
@@ -2435,7 +2435,7 @@ final class Table {
 
                // Create a list of clients to watch until they see this rejected message entry.
                HashSet<Long> deviceWatchSet = new HashSet<Long>();
 
                // Create a list of clients to watch until they see this rejected message entry.
                HashSet<Long> deviceWatchSet = new HashSet<Long>();
-               for (Map.Entry<Long, Pair<Long, 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();
 
                        // Machine ID for the last message entry
                        int64_t lastMessageEntryMachineId = lastMessageEntry.getKey();
@@ -2446,13 +2446,13 @@ final class Table {
                                continue;
                        }
 
                                continue;
                        }
 
-                       Pair<Long, Liveness> lastMessageValue = lastMessageEntry.getValue();
+                       Pair<int64_t Liveness> lastMessageValue = lastMessageEntry.getValue();
                        int64_t entrySequenceNumber = lastMessageValue.getFirst();
 
                        if (entrySequenceNumber < seq) {
 
                                // Add this rejected message to the set of messages that this machine ID did not see yet
                        int64_t entrySequenceNumber = lastMessageValue.getFirst();
 
                        if (entrySequenceNumber < seq) {
 
                                // Add this rejected message to the set of messages that this machine ID did not see yet
-                               addWatchList(lastMessageEntryMachineId, entry);
+                               addWatchVector(lastMessageEntryMachineId, entry);
 
                                // This client did not see this rejected message yet so add it to the watch set to monitor
                                deviceWatchSet.add(lastMessageEntryMachineId);
 
                                // This client did not see this rejected message yet so add it to the watch set to monitor
                                deviceWatchSet.add(lastMessageEntryMachineId);
@@ -2553,11 +2553,11 @@ final class Table {
                }
 
                // This part is still alive
                }
 
                // This part is still alive
-               Hashtable<Pair<Long, Integer>, 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
 
                if (transactionPart == NULL) {
                        // Dont have a table for this machine Id yet so make one
-                       transactionPart = new Hashtable<Pair<Long, Integer>, TransactionPart>();
+                       transactionPart = new Hashtable<Pair<int64_t int32_t>, TransactionPart>();
                        newTransactionParts.put(entry.getMachineId(), transactionPart);
                }
 
                        newTransactionParts.put(entry.getMachineId(), transactionPart);
                }
 
@@ -2587,11 +2587,11 @@ final class Table {
 
 
 
 
 
 
-               Hashtable<Pair<Long, Integer>, 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
 
                if (commitPart == NULL) {
                        // Don't have a table for this machine Id yet so make one
-                       commitPart = new Hashtable<Pair<Long, Integer>, CommitPart>();
+                       commitPart = new Hashtable<Pair<int64_t int32_t>, CommitPart>();
                        newCommitParts.put(entry.getMachineId(), commitPart);
                }
 
                        newCommitParts.put(entry.getMachineId(), commitPart);
                }
 
@@ -2614,7 +2614,7 @@ final class Table {
                machineSet.remove(machineId);
 
                // Get the set of rejected messages that this machine Id is has not seen yet
                machineSet.remove(machineId);
 
                // Get the set of rejected messages that this machine Id is has not seen yet
-               HashSet<RejectedMessage> watchset = rejectedMessageWatchListTable.get(machineId);
+               HashSet<RejectedMessage> watchset = rejectedMessageWatchVectorTable.get(machineId);
 
                // If there is a rejected message that this machine Id has not seen yet
                if (watchset != NULL) {
 
                // If there is a rejected message that this machine Id has not seen yet
                if (watchset != NULL) {
@@ -2664,7 +2664,7 @@ final class Table {
                }
 
                // Get the old last message for this device
                }
 
                // Get the old last message for this device
-               Pair<Long, Liveness> lastMessageEntry = lastMessageTable.put(machineId, new Pair<Long, Liveness>(seqNum, liveness));
+               Pair<int64_t Liveness> lastMessageEntry = lastMessageTable.put(machineId, new Pair<int64_t Liveness>(seqNum, liveness));
                if (lastMessageEntry == NULL) {
                        // If no last message then there is nothing else to process
                        return;
                if (lastMessageEntry == NULL) {
                        // If no last message then there is nothing else to process
                        return;
@@ -2710,12 +2710,12 @@ final class Table {
         * Add a rejected message entry to the watch set to keep track of which clients have seen that
         * rejected message entry and which have not.
         */
         * Add a rejected message entry to the watch set to keep track of which clients have seen that
         * rejected message entry and which have not.
         */
-       void addWatchList(int64_t machineId, RejectedMessage entry) {
-               HashSet<RejectedMessage> entries = rejectedMessageWatchListTable.get(machineId);
+       void addWatchVector(int64_t machineId, RejectedMessage entry) {
+               HashSet<RejectedMessage> entries = rejectedMessageWatchVectorTable.get(machineId);
                if (entries == NULL) {
                        // There is no set for this machine ID yet so create one
                        entries = new HashSet<RejectedMessage>();
                if (entries == NULL) {
                        // There is no set for this machine ID yet so create one
                        entries = new HashSet<RejectedMessage>();
-                       rejectedMessageWatchListTable.put(machineId, entries);
+                       rejectedMessageWatchVectorTable.put(machineId, entries);
                }
                entries.add(entry);
        }
                }
                entries.add(entry);
        }
index 4463c8d3952c0c6cb71affe4ca6690636d9a5cb1..b353fdf7485a30736a86221db5e6477e2fe9a0c1 100644 (file)
@@ -50,8 +50,8 @@ class Table {
        Slot * lastSlotAttemptedToSend = NULL;
        bool lastIsNewKey = false;
        int lastNewSize = 0;
        Slot * lastSlotAttemptedToSend = NULL;
        bool lastIsNewKey = false;
        int lastNewSize = 0;
-       Hashtable<Transaction *, List<int32_t> *> lastTransactionPartsSent = NULL;
-       List<Entry*> *lastPendingSendArbitrationEntriesToDelete = NULL;
+       Hashtable<Transaction *, Vector<int32_t> *> lastTransactionPartsSent = NULL;
+       Vector<Entry*> *lastPendingSendArbitrationEntriesToDelete = NULL;
        NewKey * lastNewKey = NULL;
         
         
        NewKey * lastNewKey = NULL;
         
         
@@ -61,7 +61,7 @@ class Table {
        Hashtable<IoTString *, KeyValue *> * pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions
        Hashtable<IoTString *, NewKey *> * liveNewKeyTable = NULL; // Table of live new keys
        Hashtable<int64_t, Pair<int64_t, Liveness*>*> *lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
        Hashtable<IoTString *, KeyValue *> * pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions
        Hashtable<IoTString *, NewKey *> * liveNewKeyTable = NULL; // Table of live new keys
        Hashtable<int64_t, Pair<int64_t, Liveness*>*> *lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
-       Hashtable<int64_t, HashSet<RejectedMessage*>*> *rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
+       Hashtable<int64_t, HashSet<RejectedMessage*>*> *rejectedMessageWatchVectorTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
        Hashtable<IoTString*, int64_t> *arbitratorTable = NULL; // Table of keys and their arbitrators
        Hashtable<Pair<int64_t, int64_t>*, Abort*> *liveAbortTable = NULL; // Table live abort messages
        Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>*, TransactionPart*>*> *newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server
        Hashtable<IoTString*, int64_t> *arbitratorTable = NULL; // Table of keys and their arbitrators
        Hashtable<Pair<int64_t, int64_t>*, Abort*> *liveAbortTable = NULL; // Table live abort messages
        Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>*, TransactionPart*>*> *newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server
@@ -72,11 +72,11 @@ class Table {
        Hashtable<int64_t, Hashtable<int64_t, Commit*>> *liveCommitsTable = NULL;
        Hashtable<IoTString*, Commit*> *liveCommitsByKeyTable = NULL;
        Hashtable<int64_t, int64_t> *lastCommitSeenSequenceNumberByArbitratorTable = NULL;
        Hashtable<int64_t, Hashtable<int64_t, Commit*>> *liveCommitsTable = NULL;
        Hashtable<IoTString*, Commit*> *liveCommitsByKeyTable = NULL;
        Hashtable<int64_t, int64_t> *lastCommitSeenSequenceNumberByArbitratorTable = NULL;
-       Vector<int64_t> * rejectedSlotList = NULL; // List of rejected slots that have yet to be sent to the server
-       List<Transaction*> *pendingTransactionQueue = NULL;
-       List<ArbitrationRound*> *pendingSendArbitrationRounds = NULL;
-       List<Entry*> *pendingSendArbitrationEntriesToDelete = NULL;
-       Hashtable<Transaction*, List<Integer*>*> *transactionPartsSent = NULL;
+       Vector<int64_t> * rejectedSlotVector = NULL; // Vector of rejected slots that have yet to be sent to the server
+       Vector<Transaction*> *pendingTransactionQueue = NULL;
+       Vector<ArbitrationRound*> *pendingSendArbitrationRounds = NULL;
+       Vector<Entry*> *pendingSendArbitrationEntriesToDelete = NULL;
+       Hashtable<Transaction*, Vector<int32_t*>*> *transactionPartsSent = NULL;
        Hashtable<int64_t, TransactionStatus*> *outstandingTransactionStatus = NULL;
        Hashtable<int64_t, Abort*> *liveAbortsGeneratedByLocal = NULL;
        Hashset<Pair<int64_t, int64_t>*> *offlineTransactionsCommittedAndAtServer = NULL;
        Hashtable<int64_t, TransactionStatus*> *outstandingTransactionStatus = NULL;
        Hashtable<int64_t, Abort*> *liveAbortsGeneratedByLocal = NULL;
        Hashset<Pair<int64_t, int64_t>*> *offlineTransactionsCommittedAndAtServer = NULL;
@@ -222,7 +222,7 @@ class Table {
                * Add a rejected message entry to the watch set to keep track of which clients have seen that
                * rejected message entry and which have not.
                */
                * Add a rejected message entry to the watch set to keep track of which clients have seen that
                * rejected message entry and which have not.
                */
-        void addWatchList(int64_t machineId, RejectedMessage entry);
+        void addWatchVector(int64_t machineId, RejectedMessage entry);
 
         /**
                * Check if the HMAC chain is not violated
 
         /**
                * Check if the HMAC chain is not violated
index 532d6e571e0b81e16457755af8f29ffcfb2ac83c..d5abcc136dadad144542a2424f711c5a8101fba6 100644 (file)
@@ -2,9 +2,9 @@
 
 class Transaction {
 
 
 class Transaction {
 
-    Hashtable<Integer, TransactionPart> parts = NULL;
-    Set<Integer> missingParts = NULL;
-    List<Integer> partsPendingSend = NULL;
+    Hashtable<int32_t, TransactionPart> parts = NULL;
+    Set<int32_t> missingParts = NULL;
+    Vector<int32_t> partsPendingSend = NULL;
     bool isComplete = false;
     bool hasLastPart = false;
     Set<KeyValue> keyValueGuardSet = NULL;
     bool isComplete = false;
     bool hasLastPart = false;
     Set<KeyValue> keyValueGuardSet = NULL;
@@ -24,10 +24,10 @@ class Transaction {
     bool hadServerFailure = false;
 
     Transaction() {
     bool hadServerFailure = false;
 
     Transaction() {
-        parts = new Hashtable<Integer, TransactionPart>();
+        parts = new Hashtable<int32_t, TransactionPart>();
         keyValueGuardSet = new HashSet<KeyValue>();
         keyValueUpdateSet = new HashSet<KeyValue>();
         keyValueGuardSet = new HashSet<KeyValue>();
         keyValueUpdateSet = new HashSet<KeyValue>();
-        partsPendingSend = new ArrayList<Integer>();
+        partsPendingSend = new Vector<int32_t>();
     }
 
     void addPartEncode(TransactionPart newPart) {
     }
 
     void addPartEncode(TransactionPart newPart) {
@@ -63,7 +63,7 @@ class Transaction {
             // Set dead the old one since the new one is a rescued version of this part
             previoslySeenPart.setDead();
         } else if (newPart.isLastPart()) {
             // 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++) {
             hasLastPart = true;
 
             for (int i = 0; i < newPart.getPartNumber(); i++) {
@@ -106,7 +106,7 @@ class Transaction {
     void setSequenceNumber(int64_t _sequenceNumber) {
         sequenceNumber = _sequenceNumber;
 
     void setSequenceNumber(int64_t _sequenceNumber) {
         sequenceNumber = _sequenceNumber;
 
-        for (Integer i : parts.keySet()) {
+        for (int32_t i : parts.keySet()) {
             parts.get(i).setSequenceNumber(sequenceNumber);
         }
     }
             parts.get(i).setSequenceNumber(sequenceNumber);
         }
     }
@@ -115,7 +115,7 @@ class Transaction {
         return clientLocalSequenceNumber;
     }
 
         return clientLocalSequenceNumber;
     }
 
-    Hashtable<Integer, TransactionPart> getParts() {
+    Hashtable<int32_t, TransactionPart> getParts() {
         return parts;
     }
 
         return parts;
     }
 
@@ -159,7 +159,7 @@ class Transaction {
         return transactionStatus;
     }
 
         return transactionStatus;
     }
 
-    void removeSentParts(List<Integer> sentParts) {
+    void removeSentParts(Vector<int32_t> sentParts) {
         nextPartToSend = 0;
         if(partsPendingSend.removeAll(sentParts))
         {
         nextPartToSend = 0;
         if(partsPendingSend.removeAll(sentParts))
         {
@@ -206,7 +206,7 @@ class Transaction {
         isDead = true;
 
         // Make all the parts of this transaction dead
         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();
         }
             TransactionPart part = parts.get(partNumber);
             part.setDead();
         }
index d59f71046ee0a551c144e2a7b63c1b960614a9e7..dab4949a4e93b30a3f1dd53e6d3dc1a91a17718f 100644 (file)
@@ -6,7 +6,7 @@ class Transaction {
  private:
        Hashtable<int32_t, TransactionPart *> parts = NULL;
        Set<int32_t> missingParts = NULL;
  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 isComplete = false;
   bool hasLastPart = false;
        Hashset<KeyValue *> * keyValueGuardSet = NULL;
@@ -26,10 +26,10 @@ class Transaction {
  bool hadServerFailure = false;
 
     public Transaction() {
  bool hadServerFailure = false;
 
     public Transaction() {
-        parts = new Hashtable<Integer, TransactionPart>();
+        parts = new Hashtable<int32_t, TransactionPart>();
         keyValueGuardSet = new HashSet<KeyValue>();
         keyValueUpdateSet = new HashSet<KeyValue>();
         keyValueGuardSet = new HashSet<KeyValue>();
         keyValueUpdateSet = new HashSet<KeyValue>();
-        partsPendingSend = new ArrayList<Integer>();
+        partsPendingSend = new Vector<int32_t>();
     }
 
     public void addPartEncode(TransactionPart newPart) {
     }
 
     public void addPartEncode(TransactionPart newPart) {
@@ -65,7 +65,7 @@ class Transaction {
             // Set dead the old one since the new one is a rescued version of this part
             previoslySeenPart.setDead();
         } else if (newPart.isLastPart()) {
             // 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++) {
             hasLastPart = true;
 
             for (int i = 0; i < newPart.getPartNumber(); i++) {
@@ -108,7 +108,7 @@ class Transaction {
     public void setSequenceNumber(int64_t _sequenceNumber) {
         sequenceNumber = _sequenceNumber;
 
     public void setSequenceNumber(int64_t _sequenceNumber) {
         sequenceNumber = _sequenceNumber;
 
-        for (Integer i : parts.keySet()) {
+        for (int32_t i : parts.keySet()) {
             parts.get(i).setSequenceNumber(sequenceNumber);
         }
     }
             parts.get(i).setSequenceNumber(sequenceNumber);
         }
     }
@@ -117,7 +117,7 @@ class Transaction {
         return clientLocalSequenceNumber;
     }
 
         return clientLocalSequenceNumber;
     }
 
-    public Hashtable<Integer, TransactionPart> getParts() {
+    public Hashtable<int32_t, TransactionPart> getParts() {
         return parts;
     }
 
         return parts;
     }
 
@@ -161,7 +161,7 @@ class Transaction {
         return transactionStatus;
     }
 
         return transactionStatus;
     }
 
-    public void removeSentParts(List<Integer> sentParts) {
+    public void removeSentParts(Vector<int32_t> sentParts) {
         nextPartToSend = 0;
         if(partsPendingSend.removeAll(sentParts))
         {
         nextPartToSend = 0;
         if(partsPendingSend.removeAll(sentParts))
         {
@@ -208,7 +208,7 @@ class Transaction {
         isDead = true;
 
         // Make all the parts of this transaction dead
         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();
         }
             TransactionPart part = parts.get(partNumber);
             part.setDead();
         }
index 139b3d2ab86abbbfb11db55f990d49c4886b4237..6e0528fa66d96a7d3491e3d0e6ebf382978ff0a8 100644 (file)
@@ -13,7 +13,7 @@ class TransactionPart extends Entry {
     Boolean isLastPart = false;
 
     Pair<int64_t, int64_t> transactionId = NULL;
     Boolean isLastPart = false;
 
     Pair<int64_t, int64_t> transactionId = NULL;
-    Pair<Long, Integer> partId = NULL;
+    Pair<int64_t int32_t> partId = NULL;
 
     char[] data = NULL;
 
 
     char[] data = NULL;
 
@@ -27,7 +27,7 @@ class TransactionPart extends Entry {
         isLastPart = _isLastPart;
 
         transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
         isLastPart = _isLastPart;
 
         transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
-        partId = new Pair<Long, Integer>(clientLocalSequenceNumber, partNumber);
+        partId = new Pair<int64_t int32_t>(clientLocalSequenceNumber, partNumber);
 
     }
 
 
     }
 
@@ -50,7 +50,7 @@ class TransactionPart extends Entry {
         return arbitratorId;
     }
 
         return arbitratorId;
     }
 
-    Pair<Long, Integer> getPartId() {
+    Pair<int64_t int32_t> getPartId() {
         return partId;
     }
 
         return partId;
     }
 
index 806cb3106469e0bfd44cb2647ef78e9e25eb97e6..4b35977eed92f40f49ee342db248590737f36249 100644 (file)
@@ -13,7 +13,7 @@ class TransactionPart extends Entry {
     private Boolean isLastPart = false;
 
     private Pair<int64_t, int64_t> transactionId = NULL;
     private Boolean isLastPart = false;
 
     private Pair<int64_t, int64_t> transactionId = NULL;
-    private Pair<Long, Integer> partId = NULL;
+    private Pair<int64_t int32_t> partId = NULL;
 
     private char[] data = NULL;
 
 
     private char[] data = NULL;
 
@@ -27,7 +27,7 @@ class TransactionPart extends Entry {
         isLastPart = _isLastPart;
 
         transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
         isLastPart = _isLastPart;
 
         transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
-        partId = new Pair<Long, Integer>(clientLocalSequenceNumber, partNumber);
+        partId = new Pair<int64_t int32_t>(clientLocalSequenceNumber, partNumber);
 
     }
 
 
     }
 
@@ -50,7 +50,7 @@ class TransactionPart extends Entry {
         return arbitratorId;
     }
 
         return arbitratorId;
     }
 
-    public Pair<Long, Integer> getPartId() {
+    public Pair<int64_t int32_t> getPartId() {
         return partId;
     }
 
         return partId;
     }
 
index 648377ef0d20de105dd3d2bfe63dafac3dc38be0..b27dde245c6a6acdf4a48184cfa4539ca2bf20bd 100644 (file)
@@ -53,7 +53,7 @@ inline bool defaultEquals(_Key key1, _Key key2) {
  *
  * @tparam _Key    Type name for the key
  * @tparam _Val    Type name for the values to be stored
  *
  * @tparam _Key    Type name for the key
  * @tparam _Val    Type name for the values to be stored
- * @tparam _KeyInt Integer type that is at least as large as _Key. Used for key
+ * @tparam _KeyInt int32_t type that is at least as large as _Key. Used for key
  *                 manipulation and storage.
  * @tparam _Shift  Logical shift to apply to all keys. Default 0.
  */
  *                 manipulation and storage.
  * @tparam _Shift  Logical shift to apply to all keys. Default 0.
  */