edit
authorbdemsky <bdemsky@uci.edu>
Fri, 19 Jan 2018 01:45:59 +0000 (17:45 -0800)
committerbdemsky <bdemsky@uci.edu>
Fri, 19 Jan 2018 01:45:59 +0000 (17:45 -0800)
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

index 3b3a10e0c280cf60d753af7436c5adab677cbda9..d17f3346cc8ef500ded35a9e50fe92a0fb4d02fe 100644 (file)
@@ -17,7 +17,7 @@ class CommitPart extends Entry{
     char[] data = NULL;
 
     Pair<Long, Integer> partId = NULL;
-    Pair<Long, Long> commitId = NULL;
+    Pair<int64_t, int64_t> commitId = NULL;
 
 
     CommitPart(Slot s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, char[] _data, Boolean _isLastPart) {
@@ -30,7 +30,7 @@ class CommitPart extends Entry{
         data = _data;
 
         partId = new Pair<Long, Integer>(sequenceNumber, partNumber);
-        commitId = new Pair<Long, Long>(machineId, sequenceNumber);
+        commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
     int getSize() {
@@ -60,7 +60,7 @@ class CommitPart extends Entry{
         return partId;
     }
 
-    Pair<Long, Long> getCommitId() {
+    Pair<int64_t, int64_t> getCommitId() {
         return commitId;
     }
 
index 4a481ad57ea243564af950a5f83fbbaba5d593f6..9a5772f305f2a6c755342181a91fb65781c4e819 100644 (file)
@@ -17,7 +17,7 @@ class CommitPart extends Entry{
     private char[] data = NULL;
 
     private Pair<Long, Integer> partId = NULL;
-    private Pair<Long, Long> commitId = NULL;
+    private Pair<int64_t, int64_t> commitId = NULL;
 
 
     public CommitPart(Slot s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, char[] _data, Boolean _isLastPart) {
@@ -30,7 +30,7 @@ class CommitPart extends Entry{
         data = _data;
 
         partId = new Pair<Long, Integer>(sequenceNumber, partNumber);
-        commitId = new Pair<Long, Long>(machineId, sequenceNumber);
+        commitId = new Pair<int64_t, int64_t>(machineId, sequenceNumber);
     }
 
     public int getSize() {
@@ -60,7 +60,7 @@ class CommitPart extends Entry{
         return partId;
     }
 
-    public Pair<Long, Long> getCommitId() {
+    public Pair<int64_t, int64_t> getCommitId() {
         return commitId;
     }
 
index 9d29e16cb7b02f5c349cf61145fb14fbd05d6b57..07923d58fc2ca67852265a3928340e58e713791f 100644 (file)
@@ -61,15 +61,15 @@ final class Table {
        HashMap<Long, Pair<Long, Liveness>> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
        HashMap<Long, HashSet<RejectedMessage>> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
        Map<IoTString, Long> arbitratorTable = NULL; // Table of keys and their arbitrators
-       Map<Pair<Long, Long>, Abort> liveAbortTable = NULL; // Table live abort messages
+       Map<Pair<int64_t, int64_t>, Abort> liveAbortTable = NULL; // Table live abort messages
        Map<Long, Map<Pair<Long, Integer>, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server
        Map<Long, Map<Pair<Long, Integer>, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server
-       Map<Long, Long> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
+       Map<int64_t, int64_t> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
        Map<Long, Transaction> liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number
-       Map<Pair<Long, Long>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
+       Map<Pair<int64_t, int64_t>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
        Map<Long, Map<Long, Commit>> liveCommitsTable = NULL;
        Map<IoTString, Commit> liveCommitsByKeyTable = NULL;
-       Map<Long, Long> lastCommitSeenSequenceNumberByArbitratorTable = NULL;
+       Map<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;
@@ -77,10 +77,10 @@ final class Table {
        Map<Transaction, List<Integer>> transactionPartsSent = NULL;
        Map<Long, TransactionStatus> outstandingTransactionStatus = NULL;
        Map<Long, Abort> liveAbortsGeneratedByLocal = NULL;
-       Set<Pair<Long, Long>> offlineTransactionsCommittedAndAtServer = NULL;
+       Set<Pair<int64_t, int64_t>> offlineTransactionsCommittedAndAtServer = NULL;
        Map<Long, Pair<String, Integer>> localCommunicationTable = NULL;
-       Map<Long, Long> lastTransactionSeenFromMachineFromServer = NULL;
-       Map<Long, Long> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
+       Map<int64_t, int64_t> lastTransactionSeenFromMachineFromServer = NULL;
+       Map<int64_t, int64_t> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
 
 
        Table(String baseurl, String password, int64_t _localMachineId, int listeningPort) {
@@ -117,26 +117,26 @@ final class Table {
                lastMessageTable = new HashMap<Long, Pair<Long, Liveness>>();
                rejectedMessageWatchListTable = new HashMap<Long, HashSet<RejectedMessage>>();
                arbitratorTable = new HashMap<IoTString, Long>();
-               liveAbortTable = new HashMap<Pair<Long, Long>, Abort>();
+               liveAbortTable = new HashMap<Pair<int64_t, int64_t>, Abort>();
                newTransactionParts = new HashMap<Long, Map<Pair<Long, Integer>, TransactionPart>>();
                newCommitParts = new HashMap<Long, Map<Pair<Long, Integer>, CommitPart>>();
-               lastArbitratedTransactionNumberByArbitratorTable = new HashMap<Long, Long>();
+               lastArbitratedTransactionNumberByArbitratorTable = new HashMap<int64_t, int64_t>();
                liveTransactionBySequenceNumberTable = new HashMap<Long, Transaction>();
-               liveTransactionByTransactionIdTable = new HashMap<Pair<Long, Long>, Transaction>();
+               liveTransactionByTransactionIdTable = new HashMap<Pair<int64_t, int64_t>, Transaction>();
                liveCommitsTable = new HashMap<Long, Map<Long, Commit>>();
                liveCommitsByKeyTable = new HashMap<IoTString, Commit>();
-               lastCommitSeenSequenceNumberByArbitratorTable = new HashMap<Long, Long>();
+               lastCommitSeenSequenceNumberByArbitratorTable = new HashMap<int64_t, int64_t>();
                rejectedSlotList = new Vector<Long>();
                pendingTransactionQueue = new ArrayList<Transaction>();
                pendingSendArbitrationEntriesToDelete = new ArrayList<Entry>();
                transactionPartsSent = new HashMap<Transaction, List<Integer>>();
                outstandingTransactionStatus = new HashMap<Long, TransactionStatus>();
                liveAbortsGeneratedByLocal = new HashMap<Long, Abort>();
-               offlineTransactionsCommittedAndAtServer = new HashSet<Pair<Long, Long>>();
+               offlineTransactionsCommittedAndAtServer = new HashSet<Pair<int64_t, int64_t>>();
                localCommunicationTable = new HashMap<Long, Pair<String, Integer>>();
-               lastTransactionSeenFromMachineFromServer = new HashMap<Long, Long>();
+               lastTransactionSeenFromMachineFromServer = new HashMap<int64_t, int64_t>();
                pendingSendArbitrationRounds = new ArrayList<ArbitrationRound>();
-               lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap<Long, Long>();
+               lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap<int64_t, int64_t>();
 
 
                // Other init stuff
@@ -2524,7 +2524,7 @@ final class Table {
 
 
                // Set dead a transaction if we can
-               Transaction transactionToSetDead = liveTransactionByTransactionIdTable.remove(new Pair<Long, Long>(entry.getTransactionMachineId(), entry.getTransactionClientLocalSequenceNumber()));
+               Transaction transactionToSetDead = liveTransactionByTransactionIdTable.remove(new Pair<int64_t, int64_t>(entry.getTransactionMachineId(), entry.getTransactionClientLocalSequenceNumber()));
                if (transactionToSetDead != NULL) {
                        liveTransactionBySequenceNumberTable.remove(transactionToSetDead.getSequenceNumber());
                }
@@ -2637,7 +2637,7 @@ final class Table {
                }
 
                // Set dead the abort
-               for (Iterator<Map.Entry<Pair<Long, Long>, Abort>> i = liveAbortTable.entrySet().iterator(); i.hasNext();) {
+               for (Iterator<Map.Entry<Pair<int64_t, int64_t>, Abort>> i = liveAbortTable.entrySet().iterator(); i.hasNext();) {
                        Abort abort = i.next().getValue();
 
                        if ((abort.getTransactionMachineId() == machineId) && (abort.getSequenceNumber() <= seqNum)) {
index 5df63763d8afc158cc35071a708dd1f90678686e..4a6fe5604d0665ddf25e39d03222a8bafd238dd0 100644 (file)
@@ -61,15 +61,15 @@ final public class Table {
        private HashMap<Long, Pair<Long, Liveness>> lastMessageTable = NULL; // Last message sent by a client machine id -> (Seq Num, Slot or LastMessage);
        private HashMap<Long, HashSet<RejectedMessage>> rejectedMessageWatchListTable = NULL; // Table of machine Ids and the set of rejected messages they have not seen yet
        private Map<IoTString, Long> arbitratorTable = NULL; // Table of keys and their arbitrators
-       private Map<Pair<Long, Long>, Abort> liveAbortTable = NULL; // Table live abort messages
+       private Map<Pair<int64_t, int64_t>, Abort> liveAbortTable = NULL; // Table live abort messages
        private Map<Long, Map<Pair<Long, Integer>, TransactionPart>> newTransactionParts = NULL; // transaction parts that are seen in this latest round of slots from the server
        private Map<Long, Map<Pair<Long, Integer>, CommitPart>> newCommitParts = NULL; // commit parts that are seen in this latest round of slots from the server
-       private Map<Long, Long> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
+       private Map<int64_t, int64_t> lastArbitratedTransactionNumberByArbitratorTable = NULL; // Last transaction sequence number that an arbitrator arbitrated on
        private Map<Long, Transaction> liveTransactionBySequenceNumberTable = NULL; // live transaction grouped by the sequence number
-       private Map<Pair<Long, Long>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
+       private Map<Pair<int64_t, int64_t>, Transaction> liveTransactionByTransactionIdTable = NULL; // live transaction grouped by the transaction ID
        private Map<Long, Map<Long, Commit>> liveCommitsTable = NULL;
        private Map<IoTString, Commit> liveCommitsByKeyTable = NULL;
-       private Map<Long, Long> lastCommitSeenSequenceNumberByArbitratorTable = NULL;
+       private Map<int64_t, int64_t> lastCommitSeenSequenceNumberByArbitratorTable = NULL;
        private Vector<Long> rejectedSlotList = NULL; // List of rejected slots that have yet to be sent to the server
        private List<Transaction> pendingTransactionQueue = NULL;
        private List<ArbitrationRound> pendingSendArbitrationRounds = NULL;
@@ -77,10 +77,10 @@ final public class Table {
        private Map<Transaction, List<Integer>> transactionPartsSent = NULL;
        private Map<Long, TransactionStatus> outstandingTransactionStatus = NULL;
        private Map<Long, Abort> liveAbortsGeneratedByLocal = NULL;
-       private Set<Pair<Long, Long>> offlineTransactionsCommittedAndAtServer = NULL;
+       private Set<Pair<int64_t, int64_t>> offlineTransactionsCommittedAndAtServer = NULL;
        private Map<Long, Pair<String, Integer>> localCommunicationTable = NULL;
-       private Map<Long, Long> lastTransactionSeenFromMachineFromServer = NULL;
-       private Map<Long, Long> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
+       private Map<int64_t, int64_t> lastTransactionSeenFromMachineFromServer = NULL;
+       private Map<int64_t, int64_t> lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = NULL;
 
 
        public Table(String baseurl, String password, int64_t _localMachineId, int listeningPort) {
@@ -117,26 +117,26 @@ final public class Table {
                lastMessageTable = new HashMap<Long, Pair<Long, Liveness>>();
                rejectedMessageWatchListTable = new HashMap<Long, HashSet<RejectedMessage>>();
                arbitratorTable = new HashMap<IoTString, Long>();
-               liveAbortTable = new HashMap<Pair<Long, Long>, Abort>();
+               liveAbortTable = new HashMap<Pair<int64_t, int64_t>, Abort>();
                newTransactionParts = new HashMap<Long, Map<Pair<Long, Integer>, TransactionPart>>();
                newCommitParts = new HashMap<Long, Map<Pair<Long, Integer>, CommitPart>>();
-               lastArbitratedTransactionNumberByArbitratorTable = new HashMap<Long, Long>();
+               lastArbitratedTransactionNumberByArbitratorTable = new HashMap<int64_t, int64_t>();
                liveTransactionBySequenceNumberTable = new HashMap<Long, Transaction>();
-               liveTransactionByTransactionIdTable = new HashMap<Pair<Long, Long>, Transaction>();
+               liveTransactionByTransactionIdTable = new HashMap<Pair<int64_t, int64_t>, Transaction>();
                liveCommitsTable = new HashMap<Long, Map<Long, Commit>>();
                liveCommitsByKeyTable = new HashMap<IoTString, Commit>();
-               lastCommitSeenSequenceNumberByArbitratorTable = new HashMap<Long, Long>();
+               lastCommitSeenSequenceNumberByArbitratorTable = new HashMap<int64_t, int64_t>();
                rejectedSlotList = new Vector<Long>();
                pendingTransactionQueue = new ArrayList<Transaction>();
                pendingSendArbitrationEntriesToDelete = new ArrayList<Entry>();
                transactionPartsSent = new HashMap<Transaction, List<Integer>>();
                outstandingTransactionStatus = new HashMap<Long, TransactionStatus>();
                liveAbortsGeneratedByLocal = new HashMap<Long, Abort>();
-               offlineTransactionsCommittedAndAtServer = new HashSet<Pair<Long, Long>>();
+               offlineTransactionsCommittedAndAtServer = new HashSet<Pair<int64_t, int64_t>>();
                localCommunicationTable = new HashMap<Long, Pair<String, Integer>>();
-               lastTransactionSeenFromMachineFromServer = new HashMap<Long, Long>();
+               lastTransactionSeenFromMachineFromServer = new HashMap<int64_t, int64_t>();
                pendingSendArbitrationRounds = new ArrayList<ArbitrationRound>();
-               lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap<Long, Long>();
+               lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new HashMap<int64_t, int64_t>();
 
 
                // Other init stuff
@@ -2524,7 +2524,7 @@ final public class Table {
 
 
                // Set dead a transaction if we can
-               Transaction transactionToSetDead = liveTransactionByTransactionIdTable.remove(new Pair<Long, Long>(entry.getTransactionMachineId(), entry.getTransactionClientLocalSequenceNumber()));
+               Transaction transactionToSetDead = liveTransactionByTransactionIdTable.remove(new Pair<int64_t, int64_t>(entry.getTransactionMachineId(), entry.getTransactionClientLocalSequenceNumber()));
                if (transactionToSetDead != NULL) {
                        liveTransactionBySequenceNumberTable.remove(transactionToSetDead.getSequenceNumber());
                }
@@ -2637,7 +2637,7 @@ final public class Table {
                }
 
                // Set dead the abort
-               for (Iterator<Map.Entry<Pair<Long, Long>, Abort>> i = liveAbortTable.entrySet().iterator(); i.hasNext();) {
+               for (Iterator<Map.Entry<Pair<int64_t, int64_t>, Abort>> i = liveAbortTable.entrySet().iterator(); i.hasNext();) {
                        Abort abort = i.next().getValue();
 
                        if ((abort.getTransactionMachineId() == machineId) && (abort.getSequenceNumber() <= seqNum)) {
index c2bc0d184143fb914c7ee52d51afda539a6ebf64..00d0882c5da034996ffedb134410e1525500e6f1 100644 (file)
@@ -14,7 +14,7 @@ class Transaction {
     int64_t clientLocalSequenceNumber = -1;
     int64_t arbitratorId = -1;
     int64_t machineId = -1;
-    Pair<Long, Long> transactionId = NULL;
+    Pair<int64_t, int64_t> transactionId = NULL;
 
     int nextPartToSend = 0;
     bool didSendAPartToServer = false;
@@ -192,7 +192,7 @@ class Transaction {
         return isComplete;
     }
 
-    Pair<Long, Long> getId() {
+    Pair<int64_t, int64_t> getId() {
         return transactionId;
     }
 
index ad3a341d27b9a2a0e72c34ff6de9fa3556939c75..f5a5bfdc2c3ceef1402c5cc2e415648b83f29346 100644 (file)
@@ -194,7 +194,7 @@ class Transaction {
         return isComplete;
     }
 
-    public Pair<Long, Long> getId() {
+    public Pair<int64_t, int64_t> getId() {
         return transactionId;
     }
 
index 0d8e2c424f0ddcd6c33ab71b5d5f27e79e0028c7..139b3d2ab86abbbfb11db55f990d49c4886b4237 100644 (file)
@@ -12,7 +12,7 @@ class TransactionPart extends Entry {
     int partNumber = -1; // Parts position in the
     Boolean isLastPart = false;
 
-    Pair<Long, Long> transactionId = NULL;
+    Pair<int64_t, int64_t> transactionId = NULL;
     Pair<Long, Integer> partId = NULL;
 
     char[] data = NULL;
@@ -26,7 +26,7 @@ class TransactionPart extends Entry {
         data = _data;
         isLastPart = _isLastPart;
 
-        transactionId = new Pair<Long, Long>(machineId, clientLocalSequenceNumber);
+        transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
         partId = new Pair<Long, Integer>(clientLocalSequenceNumber, partNumber);
 
     }
@@ -42,7 +42,7 @@ class TransactionPart extends Entry {
         parentslot = s;
     }
 
-    Pair<Long, Long> getTransactionId() {
+    Pair<int64_t, int64_t> getTransactionId() {
         return transactionId;
     }
 
index 5d936df8f324e3fb34332d136e09f6caaa2635d8..806cb3106469e0bfd44cb2647ef78e9e25eb97e6 100644 (file)
@@ -12,7 +12,7 @@ class TransactionPart extends Entry {
     private int partNumber = -1; // Parts position in the
     private Boolean isLastPart = false;
 
-    private Pair<Long, Long> transactionId = NULL;
+    private Pair<int64_t, int64_t> transactionId = NULL;
     private Pair<Long, Integer> partId = NULL;
 
     private char[] data = NULL;
@@ -26,7 +26,7 @@ class TransactionPart extends Entry {
         data = _data;
         isLastPart = _isLastPart;
 
-        transactionId = new Pair<Long, Long>(machineId, clientLocalSequenceNumber);
+        transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
         partId = new Pair<Long, Integer>(clientLocalSequenceNumber, partNumber);
 
     }
@@ -42,7 +42,7 @@ class TransactionPart extends Entry {
         parentslot = s;
     }
 
-    public Pair<Long, Long> getTransactionId() {
+    public Pair<int64_t, int64_t> getTransactionId() {
         return transactionId;
     }