#ifndef TRANSACTION_H
#define TRANSACTION_H
#include "common.h"
+#include "Pair.h"
+#include "IoTString.h"
class Transaction {
private:
- Hashtable<int32_t, TransactionPart *> *parts = NULL;
- Hashset<int32_t> *missingParts = NULL;
- Vector<int32_t> *partsPendingSend = NULL;
- bool isComplete = false;
- bool hasLastPart = false;
- Hashset<KeyValue *> *keyValueGuardSet = NULL;
- Hashset<KeyValue *> *keyValueUpdateSet = NULL;
- bool isDead = false;
- int64_t sequenceNumber = -1;
- int64_t clientLocalSequenceNumber = -1;
- int64_t arbitratorId = -1;
- int64_t machineId = -1;
- Pair<uint64_t, uint64_t> *transactionId = NULL;
- int nextPartToSend = 0;
- bool didSendAPartToServer = false;
- TransactionStatus *transactionStatus = NULL;
- bool hadServerFailure = false;
+ Vector<TransactionPart *> *parts;
+ uint partCount;
+ Hashset<int32_t> *missingParts;
+ Vector<int32_t> *partsPendingSend;
+ bool fldisComplete;
+ bool hasLastPart;
+ Hashset<KeyValue *> *keyValueGuardSet;
+ Hashset<KeyValue *> *keyValueUpdateSet;
+ bool isDead;
+ int64_t sequenceNumber;
+ int64_t clientLocalSequenceNumber;
+ int64_t arbitratorId;
+ int64_t machineId;
+ Pair<int64_t, int64_t> transactionId;
+ uint32_t nextPartToSend;
+ bool flddidSendAPartToServer;
+ TransactionStatus *transactionStatus;
+ bool hadServerFailure;
void decodeTransactionData();
public:
int64_t getSequenceNumber();
void setSequenceNumber(int64_t _sequenceNumber);
int64_t getClientLocalSequenceNumber();
- Hashtable<int32_t, TransactionPart *> *getParts();
+ Vector<TransactionPart *> *getParts();
bool didSendAPartToServer();
void resetNextPartToSend();
TransactionPart *getNextPartToSend();
Pair<int64_t, int64_t> *getId();
void setDead();
TransactionPart *getPart(int32_t index);
- bool evaluateGuard(Hashtable<IoTString *, KeyValue *> *committedKeyValueTable, Hashtable<IoTString *, KeyValue *> *speculatedKeyValueTable, Hashtable<IoTString *, KeyValue *> *pendingTransactionSpeculatedKeyValueTable);
+ bool evaluateGuard(Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *committedKeyValueTable, Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *speculatedKeyValueTable, Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *pendingTransactionSpeculatedKeyValueTable);
};
#endif