projects
/
iotcloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
edits
[iotcloud.git]
/
version2
/
src
/
C
/
Commit.h
diff --git
a/version2/src/C/Commit.h
b/version2/src/C/Commit.h
index 752293cf2c83fb52b3c467864510b2518d4717b6..8084eb7867df037207cdbd9d8677e46afc166173 100644
(file)
--- a/
version2/src/C/Commit.h
+++ b/
version2/src/C/Commit.h
@@
-1,33
+1,34
@@
#ifndef COMMIT_H
#define COMMIT_H
#include "common.h"
#ifndef COMMIT_H
#define COMMIT_H
#include "common.h"
+#include "KeyValue.h"
class Commit {
private:
class Commit {
private:
- Hashtable<int32_t, CommitPart *, int32_t> *parts;
- Hashset<int32_t, int32_t> *missingParts;
+ Vector<CommitPart *> *parts;
+ uint32_t partCount;
+ Hashset<int32_t> *missingParts;
bool fldisComplete;
bool hasLastPart;
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();
bool isDead;
int64_t sequenceNumber;
int64_t machineId;
int64_t transactionSequenceNumber;
Hashset<IoTString *> *liveKeys;
Array<char> *convertDataToBytes();
- void setKVsMap(Hash
table<IoTString *, KeyValue *
> *newKVs);
+ void setKVsMap(Hash
set<KeyValue *, uintptr_t, 0, hashKeyValue, equalsKeyValue
> *newKVs);
public:
Commit();
Commit(int64_t _sequenceNumber, int64_t _machineId, int64_t _transactionSequenceNumber);
public:
Commit();
Commit(int64_t _sequenceNumber, int64_t _machineId, int64_t _transactionSequenceNumber);
-
void addPartDecode(CommitPart *newPart);
int64_t getSequenceNumber();
int64_t getTransactionSequenceNumber();
void addPartDecode(CommitPart *newPart);
int64_t getSequenceNumber();
int64_t getTransactionSequenceNumber();
-
Hashtable<int32_t, CommitPart *, int32_t
> *getParts();
+
Vector<CommitPart *
> *getParts();
void addKV(KeyValue *kv);
void invalidateKey(IoTString *key);
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; }
int32_t getNumberOfParts();
int64_t getMachineId() { return machineId; }
bool isComplete() { return fldisComplete; }
@@
-36,6
+37,7
@@
public:
CommitPart *getPart(int32_t index);
void createCommitParts();
void decodeCommitData();
CommitPart *getPart(int32_t index);
void createCommitParts();
void decodeCommitData();
+ friend Commit *Commit_merge(Commit *newer, Commit *older, int64_t newSequenceNumber);
};
Commit *Commit_merge(Commit *newer, Commit *older, int64_t newSequenceNumber);
};
Commit *Commit_merge(Commit *newer, Commit *older, int64_t newSequenceNumber);