edit
[iotcloud.git] / version2 / src / C / Table.h
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)) {