return urlstr;
}
-void loopWrite(TCPClient client, char *array, int bytestowrite) {
+void loopWrite(TCPClient * client, char *array, int bytestowrite) {
int byteswritten = 0;
while (bytestowrite) {
- int bytes = client.write(&array[byteswritten], bytestowrite);
+ int bytes = client->write((const unsigned char *) &array[byteswritten], bytestowrite);
if (bytes >= 0) {
byteswritten += bytes;
bytestowrite -= bytes;
}
}
-void loopRead(TCPClient client, char *array, int bytestoread) {
+void loopRead(TCPClient * client, char *array, int bytestoread) {
int bytesread = 0;
while (bytestoread) {
- int bytes = client.read(&array[bytesread], bytestoread);
+ int bytes = client->read((unsigned char *) &array[bytesread], bytestoread);
if (bytes >= 0) {
bytesread += bytes;
bytestoread -= bytes;
/* send the request */
int total = strlen(message);
- loopWrite(sockfd, message, total);
+ loopWrite(&wc.client, message, total);
free(message);
return wc;
}
TCPServer createSocket(int port) {
int fd;
- struct sockaddr_in sin;
TCPServer server = TCPServer(port);
server.begin();
}
-void writeSocketData(int fd, Array<char> *data) {
+void writeSocketData(TCPClient * fd, Array<char> *data) {
loopWrite(fd, data->internalArray(), data->length());
}
-void writeSocketInt(int fd, int32_t value) {
+void writeSocketInt(TCPClient * fd, int32_t value) {
char array[4];
array[0] = value >> 24;
array[1] = (value >> 16) & 0xff;
loopWrite(fd, array, 4);
}
-int readSocketInt(int fd) {
+int readSocketInt(TCPClient * fd) {
char array[4];
loopRead(fd, array, 4);
return (((int32_t)(unsigned char) array[0]) << 24) |
((int32_t)(unsigned char) array[3]);
}
-void readSocketData(int fd, Array<char> *data) {
+void readSocketData(TCPClient * fd, Array<char> *data) {
loopRead(fd, data->internalArray(), data->length());
}
void writeURLDataAndClose(WebConnection *wc, Array<char> *data) {
- dprintf(wc->fd, "Content-Length: %d\r\n\r\n", data->length());
- loopWrite(wc->fd, data->internalArray(), data->length());
+ char buffer[300];
+ sprintf(buffer, "Content-Length: %d\r\n\r\n", data->length());
+ wc->client.print(buffer);
+ loopWrite(&wc->client, data->internalArray(), data->length());
}
void closeURLReq(WebConnection *wc) {
- dprintf(wc->fd, "\r\n");
+ wc->client.println("");
}
void readURLData(WebConnection *wc, Array<char> *output) {
- loopRead(wc->fd, output->internalArray(), output->length());
+ loopRead(&wc->client, output->internalArray(), output->length());
}
int readURLInt(WebConnection *wc) {
char array[4];
- loopRead(wc->fd, array, 4);
+ loopRead(&wc->client, array, 4);
return (((int32_t)(unsigned char) array[0]) << 24) |
(((int32_t)(unsigned char) array[1]) << 16) |
(((int32_t)(unsigned char) array[2]) << 8) |
int offset = 0;
char newchar;
while (true) {
- int bytes = read(wc->fd, &newchar, 1);
+ int bytes = wc->client.read((unsigned char *) &newchar, 1);
if (bytes <= 0)
break;
if (offset == (numBytes - 1)) {
//throw new Error("Invalid response");
myerror("Invalid response\n");
}
- close(wc.fd);
+ wc.client.stop();
timer->endTime();
salt = saltTmp;
}
bool CloudComm::getSalt() {
- WebConnection wc = {-1, -1};
+ WebConnection wc;
+ wc.numBytes = -1;
IoTString *urlstr = NULL;
// try {
}
if (wc.numBytes == 0) {
timer->endTime();
- close(wc.fd);
+ wc.client.stop();
return false;
}
int salt_length = readURLInt(&wc);
Array<char> *tmp = new Array<char>(salt_length);
readURLData(&wc, tmp);
- close(wc.fd);
+ wc.client.stop();
salt = tmp;
timer->endTime();
if (resptype->equals(getslot)) {
delete resptype;
Array<Slot *> *tmp = processSlots(&wc);
- close(wc.fd);
+ wc.client.stop();
return tmp;
} else if (resptype->equals(putslot)) {
delete resptype;
- close(wc.fd);
+ wc.client.stop();
return NULL;
} else {
delete resptype;
- close(wc.fd);
+ wc.client.stop();
//throw new Error("Bad response to putslot");
myerror("Bad response to putslot\n");
}
delete resptype;
Array<Slot *> *tmp = processSlots(&wc);
- close(wc.fd);
+ wc.client.stop();
return tmp;
/* } catch (SocketTimeoutException *e) {
timer->endTime();
Array<char> *encryptedData = encryptSlotAndPrependIV(totalData, iv);
// Open a TCP socket connection to a local device
- int socket = createSocket(host, port);
+ TCPClient socket = createSocket(host, port);
timer->startTime();
// Send data to output (length of data, the data)
- writeSocketInt(socket, encryptedData->length());
- writeSocketData(socket, encryptedData);
+ writeSocketInt(&socket, encryptedData->length());
+ writeSocketData(&socket, encryptedData);
- int lengthOfReturnData = readSocketInt(socket);
+ int lengthOfReturnData = readSocketInt(&socket);
Array<char> *returnData = new Array<char>(lengthOfReturnData);
- readSocketData(socket, returnData);
+ readSocketData(&socket, returnData);
timer->endTime();
returnData = stripIVAndDecryptSlot(returnData);
// We are done with this socket
- close(socket);
+ socket.stop();
mac->update(returnData, 0, returnData->length() - CloudComm_HMAC_SIZE);
Array<char> *realmac = mac->doFinal();
Array<char> *recmac = new Array<char>(CloudComm_HMAC_SIZE);
pendingTransactionSpeculatedKeyValueTable(NULL),
liveNewKeyTable(NULL),
lastMessageTable(NULL),
- rejectedMessageWatchVectorTable(NULL),
+ rejectedMessageWatchMyVectorTable(NULL),
arbitratorTable(NULL),
liveAbortTable(NULL),
newTransactionParts(NULL),
liveCommitsTable(NULL),
liveCommitsByKeyTable(NULL),
lastCommitSeenSequenceNumberByArbitratorTable(NULL),
- rejectedSlotVector(NULL),
+ rejectedSlotMyVector(NULL),
pendingTransactionQueue(NULL),
pendingSendArbitrationRounds(NULL),
pendingSendArbitrationEntriesToDelete(NULL),
pendingTransactionSpeculatedKeyValueTable(NULL),
liveNewKeyTable(NULL),
lastMessageTable(NULL),
- rejectedMessageWatchVectorTable(NULL),
+ rejectedMessageWatchMyVectorTable(NULL),
arbitratorTable(NULL),
liveAbortTable(NULL),
newTransactionParts(NULL),
liveCommitsTable(NULL),
liveCommitsByKeyTable(NULL),
lastCommitSeenSequenceNumberByArbitratorTable(NULL),
- rejectedSlotVector(NULL),
+ rejectedSlotMyVector(NULL),
pendingTransactionQueue(NULL),
pendingSendArbitrationRounds(NULL),
pendingSendArbitrationEntriesToDelete(NULL),
if (pendingTransactionBuilder != NULL)
delete pendingTransactionBuilder;
{
- SetIterator<int64_t, Hashset<RejectedMessage *> *> *rmit = getKeyIterator(rejectedMessageWatchVectorTable);
+ SetIterator<int64_t, Hashset<RejectedMessage *> *> *rmit = getKeyIterator(rejectedMessageWatchMyVectorTable);
while(rmit->hasNext()) {
int64_t machineid = rmit->next();
- Hashset<RejectedMessage *> * rmset = rejectedMessageWatchVectorTable->get(machineid);
+ Hashset<RejectedMessage *> * rmset = rejectedMessageWatchMyVectorTable->get(machineid);
SetIterator<RejectedMessage *, RejectedMessage *> * mit = rmset->iterator();
while (mit->hasNext()) {
RejectedMessage * rm = mit->next();
delete rmset;
}
delete rmit;
- delete rejectedMessageWatchVectorTable;
+ delete rejectedMessageWatchMyVectorTable;
}
delete arbitratorTable;
delete liveAbortTable;
}
delete liveCommitsByKeyTable;
delete lastCommitSeenSequenceNumberByArbitratorTable;
- delete rejectedSlotVector;
+ delete rejectedSlotMyVector;
{
uint size = pendingTransactionQueue->size();
for (uint iter = 0; iter < size; iter++) {
}
delete pendingSendArbitrationEntriesToDelete;
{
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
delete trit->currVal();
pendingTransactionSpeculatedKeyValueTable = new Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals>();
liveNewKeyTable = new Hashtable<IoTString *, NewKey *, uintptr_t, 0, hashString, StringEquals >();
lastMessageTable = new Hashtable<int64_t, Pair<int64_t, Liveness *> * >();
- rejectedMessageWatchVectorTable = new Hashtable<int64_t, Hashset<RejectedMessage *> * >();
+ rejectedMessageWatchMyVectorTable = new Hashtable<int64_t, Hashset<RejectedMessage *> * >();
arbitratorTable = new Hashtable<IoTString *, int64_t, uintptr_t, 0, hashString, StringEquals>();
liveAbortTable = new Hashtable<Pair<int64_t, int64_t> *, Abort *, uintptr_t, 0, pairHashFunction, pairEquals>();
newTransactionParts = new Hashtable<int64_t, Hashtable<Pair<int64_t, int32_t> *, TransactionPart *, uintptr_t, 0, pairHashFunction, pairEquals> *>();
liveCommitsTable = new Hashtable<int64_t, Hashtable<int64_t, Commit *> * >();
liveCommitsByKeyTable = new Hashtable<IoTString *, Commit *, uintptr_t, 0, hashString, StringEquals>();
lastCommitSeenSequenceNumberByArbitratorTable = new Hashtable<int64_t, int64_t>();
- rejectedSlotVector = new Vector<int64_t>();
- pendingTransactionQueue = new Vector<Transaction *>();
- pendingSendArbitrationEntriesToDelete = new Vector<Entry *>();
- transactionPartsSent = new Hashtable<Transaction *, Vector<int32_t> *>();
+ rejectedSlotMyVector = new MyVector<int64_t>();
+ pendingTransactionQueue = new MyVector<Transaction *>();
+ pendingSendArbitrationEntriesToDelete = new MyVector<Entry *>();
+ transactionPartsSent = new Hashtable<Transaction *, MyVector<int32_t> *>();
outstandingTransactionStatus = new Hashtable<int64_t, TransactionStatus *>();
liveAbortsGeneratedByLocal = new Hashtable<int64_t, Abort *>();
offlineTransactionsCommittedAndAtServer = new Hashset<Pair<int64_t, int64_t> *, uintptr_t, 0, pairHashFunction, pairEquals>();
localCommunicationTable = new Hashtable<int64_t, Pair<IoTString *, int32_t> *>();
lastTransactionSeenFromMachineFromServer = new Hashtable<int64_t, int64_t>();
- pendingSendArbitrationRounds = new Vector<ArbitrationRound *>();
+ pendingSendArbitrationRounds = new MyVector<ArbitrationRound *>();
lastArbitrationDataLocalSequenceNumberSeenFromArbitrator = new Hashtable<int64_t, int64_t>();
// Other init stuff
}
void Table::processTransactionList(bool handlePartial) {
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *)getKeyIterator(lastTransactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *)getKeyIterator(lastTransactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetServerFailure();
}
}
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *)getKeyIterator(lastTransactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *)getKeyIterator(lastTransactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetServerFailure();
processTransactionList(true);
} else {
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(lastTransactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(lastTransactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetServerFailure();
void Table::clearSentParts() {
// Clear the sent data since we are trying again
pendingSendArbitrationEntriesToDelete->clear();
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
delete trit->currVal();
if (needsResize) {
// Reset which transaction to send
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetNextPartToSend();
processTransactionList(false);
} else {
// Reset which transaction to send
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetNextPartToSend();
/* } catch (ServerException *e) {
if (e->getType() != ServerException_TypeInputTimeout) {
// Nothing was able to be sent to the server so just clear these data structures
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetNextPartToSend();
hadPartialSendToServer = true;
// Nothing was able to be sent to the server so just clear these data structures
- SetIterator<Transaction *, Vector<int> *> *trit = (SetIterator<Transaction *, Vector<int> *> *) getKeyIterator(transactionPartsSent);
+ SetIterator<Transaction *, MyVector<int> *> *trit = (SetIterator<Transaction *, MyVector<int> *> *) getKeyIterator(transactionPartsSent);
while (trit->hasNext()) {
Transaction *transaction = trit->next();
transaction->resetNextPartToSend();
// Get the size of the send data
int sendDataSize = sizeof(int32_t) + sizeof(int64_t);
{
- Vector<TransactionPart *> *tParts = transaction->getParts();
+ MyVector<TransactionPart *> *tParts = transaction->getParts();
uint tPartsSize = tParts->size();
for (uint i = 0; i < tPartsSize; i++) {
TransactionPart *part = tParts->get(i);
bbEncode->putLong(lastArbitrationDataLocalSequenceNumber);
bbEncode->putInt(transaction->getParts()->size());
{
- Vector<TransactionPart *> *tParts = transaction->getParts();
+ MyVector<TransactionPart *> *tParts = transaction->getParts();
uint tPartsSize = tParts->size();
for (uint i = 0; i < tPartsSize; i++) {
TransactionPart *part = tParts->get(i);
// The data to send back
int returnDataSize = 0;
- Vector<Entry *> *unseenArbitrations = new Vector<Entry *>();
+ MyVector<Entry *> *unseenArbitrations = new MyVector<Entry *>();
// Get the aborts to send back
- Vector<int64_t> *abortLocalSequenceNumbers = new Vector<int64_t>();
+ MyVector<int64_t> *abortLocalSequenceNumbers = new MyVector<int64_t>();
{
SetIterator<int64_t, Abort *> *abortit = getKeyIterator(liveAbortsGeneratedByLocal);
while (abortit->hasNext())
// Get the commits to send back
Hashtable<int64_t, Commit *> *commitForClientTable = liveCommitsTable->get(localMachineId);
if (commitForClientTable != NULL) {
- Vector<int64_t> *commitLocalSequenceNumbers = new Vector<int64_t>();
+ MyVector<int64_t> *commitLocalSequenceNumbers = new MyVector<int64_t>();
{
SetIterator<int64_t, Commit *> *commitit = getKeyIterator(commitForClientTable);
while (commitit->hasNext())
}
{
- Vector<CommitPart *> *parts = commit->getParts();
+ MyVector<CommitPart *> *parts = commit->getParts();
uint nParts = parts->size();
for (uint i = 0; i < nParts; i++) {
CommitPart *commitPart = parts->get(i);
Slot *s = array->get(i);
// Process each entry in the slot
- Vector<Entry *> *entries = s->getEntries();
+ MyVector<Entry *> *entries = s->getEntries();
uint eSize = entries->size();
for (uint ei = 0; ei < eSize; ei++) {
Entry *entry = entries->get(ei);
if (*array == NULL) {
*array = new Array<Slot *>(1);
(*array)->set(0, slot);
- rejectedSlotVector->clear();
+ rejectedSlotMyVector->clear();
*isInserted = false;
return true;
} else {
*isInserted = checkSend(*array, slot);
if (!(*isInserted)) {
- rejectedSlotVector->add(slot->getSequenceNumber());
+ rejectedSlotMyVector->add(slot->getSequenceNumber());
}
return false;
} else {
- rejectedSlotVector->add(slot->getSequenceNumber());
+ rejectedSlotMyVector->add(slot->getSequenceNumber());
*isInserted = false;
return false;
}
ArbitrationRound *round = pendingSendArbitrationRounds->get(i);
bool isFull = false;
round->generateParts();
- Vector<Entry *> *parts = round->getParts();
+ MyVector<Entry *> *parts = round->getParts();
// Insert pending arbitration data
uint vsize = parts->size();
if (slot->hasSpace(part)) {
slot->addEntry(part);
- Vector<int32_t> *partsSent = transactionPartsSent->get(transaction);
+ MyVector<int32_t> *partsSent = transactionPartsSent->get(transaction);
if (partsSent == NULL) {
- partsSent = new Vector<int32_t>();
+ partsSent = new MyVector<int32_t>();
transactionPartsSent->put(transaction, partsSent);
}
partsSent->add(part->getPartNumber());
}
void Table::doRejectedMessages(Slot *s) {
- if (!rejectedSlotVector->isEmpty()) {
+ if (!rejectedSlotMyVector->isEmpty()) {
/* TODO: We should avoid generating a rejected message entry if
* there is already a sufficient entry in the queue (e->g->,
* equalsto value of true and same sequence number)-> */
- int64_t old_seqn = rejectedSlotVector->get(0);
- if (rejectedSlotVector->size() > Table_REJECTED_THRESHOLD) {
- int64_t new_seqn = rejectedSlotVector->lastElement();
+ int64_t old_seqn = rejectedSlotMyVector->get(0);
+ if (rejectedSlotMyVector->size() > Table_REJECTED_THRESHOLD) {
+ int64_t new_seqn = rejectedSlotMyVector->lastElement();
RejectedMessage *rm = new RejectedMessage(s, s->getSequenceNumber(), localMachineId, old_seqn, new_seqn, false);
s->addShallowEntry(rm);
} else {
int64_t prev_seqn = -1;
uint i = 0;
/* Go through list of missing messages */
- for (; i < rejectedSlotVector->size(); i++) {
- int64_t curr_seqn = rejectedSlotVector->get(i);
+ for (; i < rejectedSlotMyVector->size(); i++) {
+ int64_t curr_seqn = rejectedSlotMyVector->get(i);
Slot *s_msg = buffer->getSlot(curr_seqn);
if (s_msg != NULL)
break;
s->addShallowEntry(rm);
}
/* Generate rejected message entries for present messages */
- for (; i < rejectedSlotVector->size(); i++) {
- int64_t curr_seqn = rejectedSlotVector->get(i);
+ for (; i < rejectedSlotMyVector->size(); i++) {
+ int64_t curr_seqn = rejectedSlotMyVector->get(i);
Slot *s_msg = buffer->getSlot(curr_seqn);
int64_t machineid = s_msg->getMachineID();
RejectedMessage *rm = new RejectedMessage(s, s->getSequenceNumber(), machineid, curr_seqn, curr_seqn, true);
seenLiveSlot = true;
// Get all the live entries for a slot
- Vector<Entry *> *liveEntries = previousSlot->getLiveEntries(resize);
+ MyVector<Entry *> *liveEntries = previousSlot->getLiveEntries(resize);
// Iterate over all the live entries and try to rescue them
uint lESize = liveEntries->size();
if (!prevslot->isLive())
continue;
seenliveslot = true;
- Vector<Entry *> *liveentries = prevslot->getLiveEntries(resize);
+ MyVector<Entry *> *liveentries = prevslot->getLiveEntries(resize);
uint lESize = liveentries->size();
for (uint i = 0; i < lESize; i++) {
Entry *liveentry = liveentries->get(i);
}
// Get the transaction sequence numbers and sort from oldest to newest
- Vector<int64_t> *transactionSequenceNumbers = new Vector<int64_t>();
+ MyVector<int64_t> *transactionSequenceNumbers = new MyVector<int64_t>();
{
SetIterator<int64_t, Transaction *> *trit = getKeyIterator(liveTransactionBySequenceNumberTable);
while (trit->hasNext())
// Append all the commit parts to the end of the pending queue
// waiting for sending to the server
// Insert the commit so we can process it
- Vector<CommitPart *> *parts = newCommit->getParts();
+ MyVector<CommitPart *> *parts = newCommit->getParts();
uint partsSize = parts->size();
for (uint i = 0; i < partsSize; i++) {
CommitPart *commitPart = parts->get(i);
if (compactArbitrationData()) {
ArbitrationRound *newArbitrationRound = pendingSendArbitrationRounds->get(pendingSendArbitrationRounds->size() - 1);
if (newArbitrationRound->getCommit() != NULL) {
- Vector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
+ MyVector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
uint partsSize = parts->size();
for (uint i = 0; i < partsSize; i++) {
CommitPart *commitPart = parts->get(i);
if (compactArbitrationData()) {
ArbitrationRound *newArbitrationRound = pendingSendArbitrationRounds->get(pendingSendArbitrationRounds->size() - 1);
- Vector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
+ MyVector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
uint partsSize = parts->size();
for (uint i = 0; i < partsSize; i++) {
CommitPart *commitPart = parts->get(i);
}
} else {
// Insert the commit so we can process it
- Vector<CommitPart *> *parts = newCommit->getParts();
+ MyVector<CommitPart *> *parts = newCommit->getParts();
uint partsSize = parts->size();
for (uint i = 0; i < partsSize; i++) {
CommitPart *commitPart = parts->get(i);
if (compactArbitrationData()) {
ArbitrationRound *newArbitrationRound = pendingSendArbitrationRounds->get(pendingSendArbitrationRounds->size() - 1);
- Vector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
+ MyVector<CommitPart *> *parts = newArbitrationRound->getCommit()->getParts();
uint partsSize = parts->size();
for (uint i = 0; i < partsSize; i++) {
CommitPart *commitPart = parts->get(i);
Hashtable<int64_t, Commit *> *commitForClientTable = liveCommitsTable->get(arbitratorId);
// Sort the commits in order
- Vector<int64_t> *commitSequenceNumbers = new Vector<int64_t>();
+ MyVector<int64_t> *commitSequenceNumbers = new MyVector<int64_t>();
{
SetIterator<int64_t, Commit *> *clientit = getKeyIterator(commitForClientTable);
while (clientit->hasNext())
// Create a list of the transaction sequence numbers and sort them
// from oldest to newest
- Vector<int64_t> *transactionSequenceNumbersSorted = new Vector<int64_t>();
+ MyVector<int64_t> *transactionSequenceNumbersSorted = new MyVector<int64_t>();
{
SetIterator<int64_t, Transaction *> *trit = getKeyIterator(liveTransactionBySequenceNumberTable);
while (trit->hasNext())
updateLastMessage(slot->getMachineID(), slot->getSequenceNumber(), slot, acceptUpdatesToLocal, machineSet);
// Process each entry in the slot
- Vector<Entry *> *entries = slot->getEntries();
+ MyVector<Entry *> *entries = slot->getEntries();
uint eSize = entries->size();
for (uint ei = 0; ei < eSize; ei++) {
Entry *entry = entries->get(ei);
if (entrySequenceNumber < seq) {
// Add this rejected message to the set of messages that this
// machine ID did not see yet
- addWatchVector(lastMessageEntryMachineId, entry);
+ addWatchMyVector(lastMessageEntryMachineId, entry);
// This client did not see this rejected message yet so add it
// to the watch set to monitor
deviceWatchSet->add(lastMessageEntryMachineId);
machineSet->remove(machineId);
// Get the set of rejected messages that this machine Id is has not seen yet
- Hashset<RejectedMessage *> *watchset = rejectedMessageWatchVectorTable->get(machineId);
+ Hashset<RejectedMessage *> *watchset = rejectedMessageWatchMyVectorTable->get(machineId);
// If there is a rejected message that this machine Id has not seen yet
if (watchset != NULL) {
// Go through each rejected message that this machine Id has not
* which clients have seen that rejected message entry and which have
* not.
*/
-void Table::addWatchVector(int64_t machineId, RejectedMessage *entry) {
- Hashset<RejectedMessage *> *entries = rejectedMessageWatchVectorTable->get(machineId);
+void Table::addWatchMyVector(int64_t machineId, RejectedMessage *entry) {
+ Hashset<RejectedMessage *> *entries = rejectedMessageWatchMyVectorTable->get(machineId);
if (entries == NULL) {
// There is no set for this machine ID yet so create one
entries = new Hashset<RejectedMessage *>();
- rejectedMessageWatchVectorTable->put(machineId, entries);
+ rejectedMessageWatchMyVectorTable->put(machineId, entries);
}
entries->add(entry);
}