From: bdemsky Date: Fri, 19 Jan 2018 01:50:30 +0000 (-0800) Subject: edit X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=commitdiff_plain;h=075451d75d86e6d0ea89e437f1e63759365eb8be edit --- diff --git a/version2/src/C/Commit.cc b/version2/src/C/Commit.cc index 32e2175..5c61692 100644 --- a/version2/src/C/Commit.cc +++ b/version2/src/C/Commit.cc @@ -1,7 +1,7 @@ #include "commit.h" Commit::Commit() : - parts(new HashMap()), + parts(new Hashtable()), missingParts(NULL), fldisComplete(false), hasLastPart(false), @@ -15,7 +15,7 @@ Commit::Commit() : Commit::Commit(int64_t _sequenceNumber, int64_t _machineId, int64_t _transactionSequenceNumber) : - parts(new HashMap()), + parts(new Hashtable()), missingParts(NULL), fldisComplete(true), hasLastPart(false), @@ -81,7 +81,7 @@ void Commit::addPartDecode(CommitPart newPart) { return transactionSequenceNumber; } - Map getParts() { + Hashtable getParts() { return parts; } @@ -218,7 +218,7 @@ int32_t getNumberOfParts() { return bbEncode.array(); } - void setKVsMap(Map newKVs) { + void setKVsMap(Hashtable newKVs) { keyValueUpdateSet.clear(); liveKeys.clear(); @@ -236,7 +236,7 @@ int32_t getNumberOfParts() { return older; } - Map kvSet = new HashMap(); + Hashtable kvSet = new Hashtable(); for (KeyValue kv : older.getKeyValueUpdateSet()) { kvSet.put(kv.getKey(), kv); } diff --git a/version2/src/C/Table.cc b/version2/src/C/Table.cc index 07923d5..0a70459 100644 --- a/version2/src/C/Table.cc +++ b/version2/src/C/Table.cc @@ -48,39 +48,39 @@ final class Table { Slot lastSlotAttemptedToSend = NULL; bool lastIsNewKey = false; int lastNewSize = 0; - Map> lastTransactionPartsSent = NULL; + Hashtable> lastTransactionPartsSent = NULL; List lastPendingSendArbitrationEntriesToDelete = NULL; NewKey lastNewKey = NULL; /* Data Structures */ - Map committedKeyValueTable = NULL; // Table of committed key value pairs - Map speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value - Map pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions - Map liveNewKeyTable = NULL; // Table of live new keys - HashMap> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage); - HashMap> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet - Map arbitratorTable = NULL; // Table of keys and their arbitrators - Map, Abort> liveAbortTable = NULL; // Table live abort messages - Map, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server - Map, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server - Map lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on - Map liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number - Map, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID - Map> liveCommitsTable = NULL; - Map liveCommitsByKeyTable = NULL; - Map lastCommitSeenSequenceNumberByArbitratorTable = NULL; + Hashtable committedKeyValueTable = NULL; // Table of committed key value pairs + Hashtable speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value + Hashtable pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions + Hashtable liveNewKeyTable = NULL; // Table of live new keys + Hashtable> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage); + Hashtable> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet + Hashtable arbitratorTable = NULL; // Table of keys and their arbitrators + Hashtable, Abort> liveAbortTable = NULL; // Table live abort messages + Hashtable, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server + Hashtable, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server + Hashtable lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on + Hashtable liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number + Hashtable, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID + Hashtable> liveCommitsTable = NULL; + Hashtable liveCommitsByKeyTable = NULL; + Hashtable lastCommitSeenSequenceNumberByArbitratorTable = NULL; Vector rejectedSlotList = NULL; // List of rejected slots that have yet to be sent to the server List pendingTransactionQueue = NULL; List pendingSendArbitrationRounds = NULL; List pendingSendArbitrationEntriesToDelete = NULL; - Map> transactionPartsSent = NULL; - Map outstandingTransactionStatus = NULL; - Map liveAbortsGeneratedByLocal = NULL; + Hashtable> transactionPartsSent = NULL; + Hashtable outstandingTransactionStatus = NULL; + Hashtable liveAbortsGeneratedByLocal = NULL; Set> offlineTransactionsCommittedAndAtServer = NULL; - Map> localCommunicationTable = NULL; - Map lastTransactionSeenFromMachineFromServer = NULL; - Map lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL; + Hashtable> localCommunicationTable = NULL; + Hashtable lastTransactionSeenFromMachineFromServer = NULL; + Hashtable lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL; Table(String baseurl, String password, int64_t _localMachineId, int listeningPort) { @@ -110,33 +110,33 @@ final class Table { oldestLiveSlotSequenceNumver = 1; // init data structs - committedKeyValueTable = new HashMap(); - speculatedKeyValueTable = new HashMap(); - pendingTransactionSpeculatedKeyValueTable = new HashMap(); - liveNewKeyTable = new HashMap(); - lastMessageTable = new HashMap>(); - rejectedMessageWatchListTable = new HashMap>(); - arbitratorTable = new HashMap(); - liveAbortTable = new HashMap, Abort>(); - newTransactionParts = new HashMap, TransactionPart>>(); - newCommitParts = new HashMap, CommitPart>>(); - lastArbitratedTransactionNumberByArbitratorTable = new HashMap(); - liveTransactionBySequenceNumberTable = new HashMap(); - liveTransactionByTransactionIdTable = new HashMap, Transaction>(); - liveCommitsTable = new HashMap>(); - liveCommitsByKeyTable = new HashMap(); - lastCommitSeenSequenceNumberByArbitratorTable = new HashMap(); + committedKeyValueTable = new Hashtable(); + speculatedKeyValueTable = new Hashtable(); + pendingTransactionSpeculatedKeyValueTable = new Hashtable(); + liveNewKeyTable = new Hashtable(); + lastMessageTable = new Hashtable>(); + rejectedMessageWatchListTable = new Hashtable>(); + arbitratorTable = new Hashtable(); + liveAbortTable = new Hashtable, Abort>(); + newTransactionParts = new Hashtable, TransactionPart>>(); + newCommitParts = new Hashtable, CommitPart>>(); + lastArbitratedTransactionNumberByArbitratorTable = new Hashtable(); + liveTransactionBySequenceNumberTable = new Hashtable(); + liveTransactionByTransactionIdTable = new Hashtable, Transaction>(); + liveCommitsTable = new Hashtable>(); + liveCommitsByKeyTable = new Hashtable(); + lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable(); rejectedSlotList = new Vector(); pendingTransactionQueue = new ArrayList(); pendingSendArbitrationEntriesToDelete = new ArrayList(); - transactionPartsSent = new HashMap>(); - outstandingTransactionStatus = new HashMap(); - liveAbortsGeneratedByLocal = new HashMap(); + transactionPartsSent = new Hashtable>(); + outstandingTransactionStatus = new Hashtable(); + liveAbortsGeneratedByLocal = new Hashtable(); offlineTransactionsCommittedAndAtServer = new HashSet>(); - localCommunicationTable = new HashMap>(); - lastTransactionSeenFromMachineFromServer = new HashMap(); + localCommunicationTable = new Hashtable>(); + lastTransactionSeenFromMachineFromServer = new Hashtable(); pendingSendArbitrationRounds = new ArrayList(); - lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap(); + lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new Hashtable(); // Other init stuff @@ -761,7 +761,7 @@ final class Table { lastInsertedNewKey = insertedNewKey; lastNewSize = newSize; lastNewKey = newKey; - lastTransactionPartsSent = new HashMap>(transactionPartsSent); + lastTransactionPartsSent = new Hashtable>(transactionPartsSent); lastPendingSendArbitrationEntriesToDelete = new ArrayList(pendingSendArbitrationEntriesToDelete); @@ -880,7 +880,7 @@ final class Table { // if (!fromRetry) { - // lastTransactionPartsSent = new HashMap>(transactionPartsSent); + // lastTransactionPartsSent = new Hashtable>(transactionPartsSent); // lastPendingSendArbitrationEntriesToDelete = new ArrayList(pendingSendArbitrationEntriesToDelete); // } @@ -1089,7 +1089,7 @@ final class Table { } // Get the commits to send back - Map commitForClientTable = liveCommitsTable.get(localMachineId); + Hashtable commitForClientTable = liveCommitsTable.get(localMachineId); if (commitForClientTable != NULL) { List commitLocalSequenceNumbers = new ArrayList(commitForClientTable.keySet()); Collections.sort(commitLocalSequenceNumbers); @@ -1626,7 +1626,7 @@ final class Table { // Iterate through all the machine Ids that we received new parts for for (Long machineId : newTransactionParts.keySet()) { - Map, TransactionPart> parts = newTransactionParts.get(machineId); + Hashtable, TransactionPart> parts = newTransactionParts.get(machineId); // Iterate through all the parts for that machine Id for (Pair partId : parts.keySet()) { @@ -1675,7 +1675,7 @@ final class Table { Collections.sort(transactionSequenceNumbers); // Collection of key value pairs that are - Map speculativeTableTmp = new HashMap(); + Hashtable speculativeTableTmp = new Hashtable(); // The last transaction arbitrated on int64_t lastTransactionCommitted = -1; @@ -2000,18 +2000,18 @@ final class Table { // Iterate through all the machine Ids that we received new parts for for (Long machineId : newCommitParts.keySet()) { - Map, CommitPart> parts = newCommitParts.get(machineId); + Hashtable, CommitPart> parts = newCommitParts.get(machineId); // Iterate through all the parts for that machine Id for (Pair partId : parts.keySet()) { CommitPart part = parts.get(partId); // Get the transaction object for that sequence number - Map commitForClientTable = liveCommitsTable.get(part.getMachineId()); + Hashtable commitForClientTable = liveCommitsTable.get(part.getMachineId()); if (commitForClientTable == NULL) { // This is the first commit from this device - commitForClientTable = new HashMap(); + commitForClientTable = new Hashtable(); liveCommitsTable.put(part.getMachineId(), commitForClientTable); } @@ -2040,7 +2040,7 @@ final class Table { for (Long arbitratorId : liveCommitsTable.keySet()) { // Get all the commits for a specific arbitrator - Map commitForClientTable = liveCommitsTable.get(arbitratorId); + Hashtable commitForClientTable = liveCommitsTable.get(arbitratorId); // Sort the commits in order List commitSequenceNumbers = new ArrayList(commitForClientTable.keySet()); @@ -2553,11 +2553,11 @@ final class Table { } // This part is still alive - Map, TransactionPart> transactionPart = newTransactionParts.get(entry.getMachineId()); + Hashtable, TransactionPart> transactionPart = newTransactionParts.get(entry.getMachineId()); if (transactionPart == NULL) { // Dont have a table for this machine Id yet so make one - transactionPart = new HashMap, TransactionPart>(); + transactionPart = new Hashtable, TransactionPart>(); newTransactionParts.put(entry.getMachineId(), transactionPart); } @@ -2587,11 +2587,11 @@ final class Table { - Map, CommitPart> commitPart = newCommitParts.get(entry.getMachineId()); + Hashtable, CommitPart> commitPart = newCommitParts.get(entry.getMachineId()); if (commitPart == NULL) { // Don't have a table for this machine Id yet so make one - commitPart = new HashMap, CommitPart>(); + commitPart = new Hashtable, CommitPart>(); newCommitParts.put(entry.getMachineId(), commitPart); } diff --git a/version2/src/C/Table.h b/version2/src/C/Table.h index 4a6fe56..b3e2d0e 100644 --- a/version2/src/C/Table.h +++ b/version2/src/C/Table.h @@ -48,39 +48,39 @@ final public class Table { private Slot lastSlotAttemptedToSend = NULL; private bool lastIsNewKey = false; private int lastNewSize = 0; - private Map> lastTransactionPartsSent = NULL; + private Hashtable> lastTransactionPartsSent = NULL; private List lastPendingSendArbitrationEntriesToDelete = NULL; private NewKey lastNewKey = NULL; /* Data Structures */ - private Map committedKeyValueTable = NULL; // Table of committed key value pairs - private Map speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value - private Map pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions - private Map liveNewKeyTable = NULL; // Table of live new keys - private HashMap> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage); - private HashMap> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet - private Map arbitratorTable = NULL; // Table of keys and their arbitrators - private Map, Abort> liveAbortTable = NULL; // Table live abort messages - private Map, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server - private Map, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server - private Map lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on - private Map liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number - private Map, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID - private Map> liveCommitsTable = NULL; - private Map liveCommitsByKeyTable = NULL; - private Map lastCommitSeenSequenceNumberByArbitratorTable = NULL; + private Hashtable committedKeyValueTable = NULL; // Table of committed key value pairs + private Hashtable speculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value + private Hashtable pendingTransactionSpeculatedKeyValueTable = NULL; // Table of speculated key value pairs, if there is a speculative value from the pending transactions + private Hashtable liveNewKeyTable = NULL; // Table of live new keys + private Hashtable> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage); + private Hashtable> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet + private Hashtable arbitratorTable = NULL; // Table of keys and their arbitrators + private Hashtable, Abort> liveAbortTable = NULL; // Table live abort messages + private Hashtable, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server + private Hashtable, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server + private Hashtable lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on + private Hashtable liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number + private Hashtable, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID + private Hashtable> liveCommitsTable = NULL; + private Hashtable liveCommitsByKeyTable = NULL; + private Hashtable lastCommitSeenSequenceNumberByArbitratorTable = NULL; private Vector rejectedSlotList = NULL; // List of rejected slots that have yet to be sent to the server private List pendingTransactionQueue = NULL; private List pendingSendArbitrationRounds = NULL; private List pendingSendArbitrationEntriesToDelete = NULL; - private Map> transactionPartsSent = NULL; - private Map outstandingTransactionStatus = NULL; - private Map liveAbortsGeneratedByLocal = NULL; + private Hashtable> transactionPartsSent = NULL; + private Hashtable outstandingTransactionStatus = NULL; + private Hashtable liveAbortsGeneratedByLocal = NULL; private Set> offlineTransactionsCommittedAndAtServer = NULL; - private Map> localCommunicationTable = NULL; - private Map lastTransactionSeenFromMachineFromServer = NULL; - private Map lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL; + private Hashtable> localCommunicationTable = NULL; + private Hashtable lastTransactionSeenFromMachineFromServer = NULL; + private Hashtable lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL; public Table(String baseurl, String password, int64_t _localMachineId, int listeningPort) { @@ -110,33 +110,33 @@ final public class Table { oldestLiveSlotSequenceNumver = 1; // init data structs - committedKeyValueTable = new HashMap(); - speculatedKeyValueTable = new HashMap(); - pendingTransactionSpeculatedKeyValueTable = new HashMap(); - liveNewKeyTable = new HashMap(); - lastMessageTable = new HashMap>(); - rejectedMessageWatchListTable = new HashMap>(); - arbitratorTable = new HashMap(); - liveAbortTable = new HashMap, Abort>(); - newTransactionParts = new HashMap, TransactionPart>>(); - newCommitParts = new HashMap, CommitPart>>(); - lastArbitratedTransactionNumberByArbitratorTable = new HashMap(); - liveTransactionBySequenceNumberTable = new HashMap(); - liveTransactionByTransactionIdTable = new HashMap, Transaction>(); - liveCommitsTable = new HashMap>(); - liveCommitsByKeyTable = new HashMap(); - lastCommitSeenSequenceNumberByArbitratorTable = new HashMap(); + committedKeyValueTable = new Hashtable(); + speculatedKeyValueTable = new Hashtable(); + pendingTransactionSpeculatedKeyValueTable = new Hashtable(); + liveNewKeyTable = new Hashtable(); + lastMessageTable = new Hashtable>(); + rejectedMessageWatchListTable = new Hashtable>(); + arbitratorTable = new Hashtable(); + liveAbortTable = new Hashtable, Abort>(); + newTransactionParts = new Hashtable, TransactionPart>>(); + newCommitParts = new Hashtable, CommitPart>>(); + lastArbitratedTransactionNumberByArbitratorTable = new Hashtable(); + liveTransactionBySequenceNumberTable = new Hashtable(); + liveTransactionByTransactionIdTable = new Hashtable, Transaction>(); + liveCommitsTable = new Hashtable>(); + liveCommitsByKeyTable = new Hashtable(); + lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable(); rejectedSlotList = new Vector(); pendingTransactionQueue = new ArrayList(); pendingSendArbitrationEntriesToDelete = new ArrayList(); - transactionPartsSent = new HashMap>(); - outstandingTransactionStatus = new HashMap(); - liveAbortsGeneratedByLocal = new HashMap(); + transactionPartsSent = new Hashtable>(); + outstandingTransactionStatus = new Hashtable(); + liveAbortsGeneratedByLocal = new Hashtable(); offlineTransactionsCommittedAndAtServer = new HashSet>(); - localCommunicationTable = new HashMap>(); - lastTransactionSeenFromMachineFromServer = new HashMap(); + localCommunicationTable = new Hashtable>(); + lastTransactionSeenFromMachineFromServer = new Hashtable(); pendingSendArbitrationRounds = new ArrayList(); - lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap(); + lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new Hashtable(); // Other init stuff @@ -761,7 +761,7 @@ final public class Table { lastInsertedNewKey = insertedNewKey; lastNewSize = newSize; lastNewKey = newKey; - lastTransactionPartsSent = new HashMap>(transactionPartsSent); + lastTransactionPartsSent = new Hashtable>(transactionPartsSent); lastPendingSendArbitrationEntriesToDelete = new ArrayList(pendingSendArbitrationEntriesToDelete); @@ -880,7 +880,7 @@ final public class Table { // if (!fromRetry) { - // lastTransactionPartsSent = new HashMap>(transactionPartsSent); + // lastTransactionPartsSent = new Hashtable>(transactionPartsSent); // lastPendingSendArbitrationEntriesToDelete = new ArrayList(pendingSendArbitrationEntriesToDelete); // } @@ -1089,7 +1089,7 @@ final public class Table { } // Get the commits to send back - Map commitForClientTable = liveCommitsTable.get(localMachineId); + Hashtable commitForClientTable = liveCommitsTable.get(localMachineId); if (commitForClientTable != NULL) { List commitLocalSequenceNumbers = new ArrayList(commitForClientTable.keySet()); Collections.sort(commitLocalSequenceNumbers); @@ -1626,7 +1626,7 @@ final public class Table { // Iterate through all the machine Ids that we received new parts for for (Long machineId : newTransactionParts.keySet()) { - Map, TransactionPart> parts = newTransactionParts.get(machineId); + Hashtable, TransactionPart> parts = newTransactionParts.get(machineId); // Iterate through all the parts for that machine Id for (Pair partId : parts.keySet()) { @@ -1675,7 +1675,7 @@ final public class Table { Collections.sort(transactionSequenceNumbers); // Collection of key value pairs that are - Map speculativeTableTmp = new HashMap(); + Hashtable speculativeTableTmp = new Hashtable(); // The last transaction arbitrated on int64_t lastTransactionCommitted = -1; @@ -2000,18 +2000,18 @@ final public class Table { // Iterate through all the machine Ids that we received new parts for for (Long machineId : newCommitParts.keySet()) { - Map, CommitPart> parts = newCommitParts.get(machineId); + Hashtable, CommitPart> parts = newCommitParts.get(machineId); // Iterate through all the parts for that machine Id for (Pair partId : parts.keySet()) { CommitPart part = parts.get(partId); // Get the transaction object for that sequence number - Map commitForClientTable = liveCommitsTable.get(part.getMachineId()); + Hashtable commitForClientTable = liveCommitsTable.get(part.getMachineId()); if (commitForClientTable == NULL) { // This is the first commit from this device - commitForClientTable = new HashMap(); + commitForClientTable = new Hashtable(); liveCommitsTable.put(part.getMachineId(), commitForClientTable); } @@ -2040,7 +2040,7 @@ final public class Table { for (Long arbitratorId : liveCommitsTable.keySet()) { // Get all the commits for a specific arbitrator - Map commitForClientTable = liveCommitsTable.get(arbitratorId); + Hashtable commitForClientTable = liveCommitsTable.get(arbitratorId); // Sort the commits in order List commitSequenceNumbers = new ArrayList(commitForClientTable.keySet()); @@ -2553,11 +2553,11 @@ final public class Table { } // This part is still alive - Map, TransactionPart> transactionPart = newTransactionParts.get(entry.getMachineId()); + Hashtable, TransactionPart> transactionPart = newTransactionParts.get(entry.getMachineId()); if (transactionPart == NULL) { // Dont have a table for this machine Id yet so make one - transactionPart = new HashMap, TransactionPart>(); + transactionPart = new Hashtable, TransactionPart>(); newTransactionParts.put(entry.getMachineId(), transactionPart); } @@ -2587,11 +2587,11 @@ final public class Table { - Map, CommitPart> commitPart = newCommitParts.get(entry.getMachineId()); + Hashtable, CommitPart> commitPart = newCommitParts.get(entry.getMachineId()); if (commitPart == NULL) { // Don't have a table for this machine Id yet so make one - commitPart = new HashMap, CommitPart>(); + commitPart = new Hashtable, CommitPart>(); newCommitParts.put(entry.getMachineId(), commitPart); } diff --git a/version2/src/C/Transaction.cc b/version2/src/C/Transaction.cc index 00d0882..532d6e5 100644 --- a/version2/src/C/Transaction.cc +++ b/version2/src/C/Transaction.cc @@ -2,7 +2,7 @@ class Transaction { - Map parts = NULL; + Hashtable parts = NULL; Set missingParts = NULL; List partsPendingSend = NULL; bool isComplete = false; @@ -24,7 +24,7 @@ class Transaction { bool hadServerFailure = false; Transaction() { - parts = new HashMap(); + parts = new Hashtable(); keyValueGuardSet = new HashSet(); keyValueUpdateSet = new HashSet(); partsPendingSend = new ArrayList(); @@ -115,7 +115,7 @@ class Transaction { return clientLocalSequenceNumber; } - Map getParts() { + Hashtable getParts() { return parts; } @@ -255,7 +255,7 @@ class Transaction { } } - bool evaluateGuard(Map committedKeyValueTable, Map speculatedKeyValueTable, Map pendingTransactionSpeculatedKeyValueTable) { + bool evaluateGuard(Hashtable committedKeyValueTable, Hashtable speculatedKeyValueTable, Hashtable pendingTransactionSpeculatedKeyValueTable) { for (KeyValue kvGuard : keyValueGuardSet) { // First check if the key is in the speculative table, this is the value of the latest assumption diff --git a/version2/src/C/Transaction.h b/version2/src/C/Transaction.h index f5a5bfd..d59f710 100644 --- a/version2/src/C/Transaction.h +++ b/version2/src/C/Transaction.h @@ -26,7 +26,7 @@ class Transaction { bool hadServerFailure = false; public Transaction() { - parts = new HashMap(); + parts = new Hashtable(); keyValueGuardSet = new HashSet(); keyValueUpdateSet = new HashSet(); partsPendingSend = new ArrayList(); @@ -117,7 +117,7 @@ class Transaction { return clientLocalSequenceNumber; } - public Map getParts() { + public Hashtable getParts() { return parts; } @@ -257,7 +257,7 @@ class Transaction { } } - public bool evaluateGuard(Map committedKeyValueTable, Map speculatedKeyValueTable, Map pendingTransactionSpeculatedKeyValueTable) { + public bool evaluateGuard(Hashtable committedKeyValueTable, Hashtable speculatedKeyValueTable, Hashtable pendingTransactionSpeculatedKeyValueTable) { for (KeyValue kvGuard : keyValueGuardSet) { // First check if the key is in the speculative table, this is the value of the latest assumption