From: bdemsky Date: Sun, 21 Jan 2018 03:34:57 +0000 (-0800) Subject: Another file compiles X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=commitdiff_plain;h=1982d44395bc486667d8b25d6d7763c2ffbf61bc Another file compiles --- diff --git a/version2/src/C/Pair.h b/version2/src/C/Pair.h index 192e93c..4da3bf7 100644 --- a/version2/src/C/Pair.h +++ b/version2/src/C/Pair.h @@ -22,4 +22,21 @@ public: } }; +template +inline unsigned int pairHashFunction(Pair p) { + return (p.getFirst() << 1) ^ p.getSecond(); +} + +template +inline bool pairEquals(Pair a, Pair b) { + return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond()); +} + +inline unsigned int pairHashFunction(Pair p) { + return (p.getFirst() << 1) ^ p.getSecond(); +} + +inline bool pairEquals(Pair a, Pair b) { + return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond()); +} #endif diff --git a/version2/src/C/Slot.cc b/version2/src/C/Slot.cc index 18d1a5d..f4247e4 100644 --- a/version2/src/C/Slot.cc +++ b/version2/src/C/Slot.cc @@ -54,12 +54,6 @@ Entry *Slot::addEntry(Entry *e) { return e; } -void Slot::removeEntry(Entry *e) { - entries->remove(e); - livecount--; - freespace += e->getSize(); -} - void Slot::addShallowEntry(Entry *e) { entries->add(e); livecount++; diff --git a/version2/src/C/Slot.h b/version2/src/C/Slot.h index 9085b3d..c91aac1 100644 --- a/version2/src/C/Slot.h +++ b/version2/src/C/Slot.h @@ -40,7 +40,6 @@ public: Array *getHMAC() { return hmac; } Array *getPrevHMAC() { return prevhmac; } Entry *addEntry(Entry *e); - void removeEntry(Entry *e); bool hasSpace(Entry *e); Vector *getEntries(); Array *encode(Mac *mac); diff --git a/version2/src/C/Table.h b/version2/src/C/Table.h index a5ea0dc..7cc98ab 100644 --- a/version2/src/C/Table.h +++ b/version2/src/C/Table.h @@ -65,12 +65,12 @@ private: Hashtable > *lastMessageTable; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage); Hashtable *> *rejectedMessageWatchVectorTable; // Table of machine Ids and the set of rejected messages they have not seen yet Hashtable *arbitratorTable;// Table of keys and their arbitrators - Hashtable, Abort *> *liveAbortTable;// Table live abort messages - Hashtable, TransactionPart *> *> *newTransactionParts; // transaction parts that are seen in this latest round of slots from the server - Hashtable, CommitPart *> *> *newCommitParts; // commit parts that are seen in this latest round of slots from the server + Hashtable, Abort *, uintptr_t, 0, pairHashFunction, pairEquals> *liveAbortTable;// Table live abort messages + Hashtable, TransactionPart *, uintptr_t, 0, pairHashFunction, pairEquals> *> *newTransactionParts; // transaction parts that are seen in this latest round of slots from the server + Hashtable, CommitPart *, uintptr_t, 0, pairHashFunction, pairEquals> *> *newCommitParts; // commit parts that are seen in this latest round of slots from the server Hashtable *lastArbitratedTransactionNumberByArbitratorTable; // Last transaction sequence number that an arbitrator arbitrated on Hashtable *liveTransactionBySequenceNumberTable; // live transaction grouped by the sequence number - Hashtable, Transaction *> *liveTransactionByTransactionIdTable; // live transaction grouped by the transaction ID + Hashtable, Transaction *, uintptr_t, 0, pairHashFunction, pairEquals> *liveTransactionByTransactionIdTable; // live transaction grouped by the transaction ID Hashtable > *liveCommitsTable; Hashtable *liveCommitsByKeyTable; Hashtable *lastCommitSeenSequenceNumberByArbitratorTable; @@ -81,7 +81,7 @@ private: Hashtable *> *transactionPartsSent; Hashtable *outstandingTransactionStatus; Hashtable *liveAbortsGeneratedByLocal; - Hashset > *offlineTransactionsCommittedAndAtServer; + Hashset, uintptr_t, 0, pairHashFunction, pairEquals> *offlineTransactionsCommittedAndAtServer; Hashtable > *localCommunicationTable; Hashtable *lastTransactionSeenFromMachineFromServer; Hashtable *lastArbitrationDataLocalSequenceNumberSeenFromArbitrator;