Another file compiles
authorbdemsky <bdemsky@uci.edu>
Sun, 21 Jan 2018 03:34:57 +0000 (19:34 -0800)
committerbdemsky <bdemsky@uci.edu>
Sun, 21 Jan 2018 03:34:57 +0000 (19:34 -0800)
version2/src/C/Pair.h
version2/src/C/Slot.cc
version2/src/C/Slot.h
version2/src/C/Table.h

index 192e93cd248fe27c1b7eb34c8333a52e47c539ba..4da3bf7f1a06f605817a043922ab4545b8b3546f 100644 (file)
@@ -22,4 +22,21 @@ public:
        }
 };
 
+template<typename A, typename B>
+inline unsigned int pairHashFunction(Pair<A, B> p) {
+       return (p.getFirst() << 1) ^ p.getSecond();
+}
+
+template<typename A, typename B>
+inline bool pairEquals(Pair<A, B> a, Pair<A, B> b) {
+       return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond());
+}
+
+inline unsigned int pairHashFunction(Pair<int64_t, int64_t> p) {
+       return (p.getFirst() << 1) ^ p.getSecond();
+}
+
+inline bool pairEquals(Pair<int64_t, int64_t> a, Pair<int64_t, int64_t> b) {
+       return ( a.getFirst() == b.getFirst() ) && (a.getSecond() == b.getSecond());
+}
 #endif
index 18d1a5dc0964c0b2de1829e8744c45fb9ac25895..f4247e44d36941c7a2c247980c4a353cd93c6084 100644 (file)
@@ -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++;
index 9085b3d9b96b6ad05f7a3bf52f0118adcd4244cf..c91aac1b1a4e60e5e41d3012c20219286278520c 100644 (file)
@@ -40,7 +40,6 @@ public:
        Array<char> *getHMAC() { return hmac; }
        Array<char> *getPrevHMAC() { return prevhmac; }
        Entry *addEntry(Entry *e);
-       void removeEntry(Entry *e);
        bool hasSpace(Entry *e);
        Vector<Entry *> *getEntries();
        Array<char> *encode(Mac *mac);
index a5ea0dc9b3c4095f1c49bca3c4c36d3ed20b37e2..7cc98abc2ff24dae7f6be3a777b36c2ed0a8d591 100644 (file)
@@ -65,12 +65,12 @@ private:
        Hashtable<int64_t, Pair<int64_t, Liveness *> > *lastMessageTable;       // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
        Hashtable<int64_t, Hashset<RejectedMessage *> *> *rejectedMessageWatchVectorTable;      // Table of machine Ids and the set of rejected messages they have not seen yet
        Hashtable<IoTString *, int64_t> *arbitratorTable;// Table of keys and their arbitrators
-       Hashtable<Pair<int64_t, int64_t>, Abort *> *liveAbortTable;// Table live abort messages
-       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, TransactionPart *> *> *newTransactionParts;        // transaction parts that are seen in this latest round of slots from the server
-       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, CommitPart *> *> *newCommitParts;  // commit parts that are seen in this latest round of slots from the server
+       Hashtable<Pair<int64_t, int64_t>, Abort *, uintptr_t, 0, pairHashFunction, pairEquals> *liveAbortTable;// Table live abort messages
+       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, TransactionPart *, uintptr_t, 0, pairHashFunction, pairEquals> *> *newTransactionParts;    // transaction parts that are seen in this latest round of slots from the server
+       Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t>, CommitPart *, uintptr_t, 0, pairHashFunction, pairEquals> *> *newCommitParts;      // commit parts that are seen in this latest round of slots from the server
        Hashtable<int64_t, int64_t> *lastArbitratedTransactionNumberByArbitratorTable;  // Last transaction sequence number that an arbitrator arbitrated on
        Hashtable<int64_t, Transaction *> *liveTransactionBySequenceNumberTable;        // live transaction grouped by the sequence number
-       Hashtable<Pair<int64_t, int64_t>, Transaction *> *liveTransactionByTransactionIdTable;  // live transaction grouped by the transaction ID
+       Hashtable<Pair<int64_t, int64_t>, Transaction *, uintptr_t, 0, pairHashFunction, pairEquals> *liveTransactionByTransactionIdTable;      // live transaction grouped by the transaction ID
        Hashtable<int64_t, Hashtable<int64_t, Commit *> > *liveCommitsTable;
        Hashtable<IoTString *, Commit *> *liveCommitsByKeyTable;
        Hashtable<int64_t, int64_t> *lastCommitSeenSequenceNumberByArbitratorTable;
@@ -81,7 +81,7 @@ private:
        Hashtable<Transaction *, Vector<int32_t> *> *transactionPartsSent;
        Hashtable<int64_t, TransactionStatus *> *outstandingTransactionStatus;
        Hashtable<int64_t, Abort *> *liveAbortsGeneratedByLocal;
-       Hashset<Pair<int64_t, int64_t> > *offlineTransactionsCommittedAndAtServer;
+       Hashset<Pair<int64_t, int64_t>, uintptr_t, 0, pairHashFunction, pairEquals> *offlineTransactionsCommittedAndAtServer;
        Hashtable<int64_t, Pair<IoTString *, int32_t> > *localCommunicationTable;
        Hashtable<int64_t, int64_t> *lastTransactionSeenFromMachineFromServer;
        Hashtable<int64_t, int64_t> *lastArbitrationDataLocalSequenceNumberSeenFromArbitrator;