#ifndef COMMIT_H
#define COMMIT_H
#include "common.h"
+#include "KeyValue.h"
class Commit {
private:
- Hashtable<int32_t, CommitPart *> *parts;
+ Vector<CommitPart *> *parts;
+ uint32_t partCount;
Hashset<int32_t> *missingParts;
bool fldisComplete;
bool hasLastPart;
- Hashset<KeyValue *> *keyValueUpdateSet;
+ Hashset<KeyValue *, uintptr_t, 0, hashKeyValue, equalsKeyValue> *keyValueUpdateSet;
bool isDead;
int64_t sequenceNumber;
int64_t machineId;
int64_t transactionSequenceNumber;
Hashset<IoTString *> *liveKeys;
Array<char> *convertDataToBytes();
- void setKVsMap(Hashtable<IoTString *, KeyValue *> *newKVs);
+ void setKVsMap(Hashset<KeyValue *, uintptr_t, 0, hashKeyValue, equalsKeyValue> *newKVs);
public:
Commit();
void addPartDecode(CommitPart *newPart);
int64_t getSequenceNumber();
int64_t getTransactionSequenceNumber();
- Hashtable<int32_t, CommitPart *> *getParts();
+ Vector<CommitPart *> *getParts();
void addKV(KeyValue *kv);
void invalidateKey(IoTString *key);
- Hashset<KeyValue *> *getKeyValueUpdateSet();
+ Hashset<KeyValue *, uintptr_t, 0, hashKeyValue, equalsKeyValue> *getKeyValueUpdateSet();
int32_t getNumberOfParts();
int64_t getMachineId() { return machineId; }
bool isComplete() { return fldisComplete; }