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) {
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() {
return partId;
}
- Pair<Long, Long> getCommitId() {
+ Pair<int64_t, int64_t> getCommitId() {
return commitId;
}
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) {
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() {
return partId;
}
- public Pair<Long, Long> getCommitId() {
+ public Pair<int64_t, int64_t> getCommitId() {
return commitId;
}
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;
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) {
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
// 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());
}
}
// 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)) {
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;
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) {
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
// 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());
}
}
// 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)) {
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;
return isComplete;
}
- Pair<Long, Long> getId() {
+ Pair<int64_t, int64_t> getId() {
return transactionId;
}
return isComplete;
}
- public Pair<Long, Long> getId() {
+ public Pair<int64_t, int64_t> getId() {
return transactionId;
}
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;
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);
}
parentslot = s;
}
- Pair<Long, Long> getTransactionId() {
+ Pair<int64_t, int64_t> getTransactionId() {
return transactionId;
}
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;
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);
}
parentslot = s;
}
- public Pair<Long, Long> getTransactionId() {
+ public Pair<int64_t, int64_t> getTransactionId() {
return transactionId;
}