#define COMMITPART_H
#include "common.h"
#include "Entry.h"
+#include "Pair.h"
// Max size of the part excluding the fixed size header
#define CommitPart_MAX_NON_HEADER_SIZE 512
class CommitPart : public Entry {
- private:
+private:
// Sequence number of the transaction this commit is for, -1 if not a cloud transaction
int64_t machineId; // Machine Id of the device that made the commit
int64_t sequenceNumber; // commit sequence number for this arbitrator
int64_t transactionSequenceNumber;
int32_t partNumber; // Parts position in the
- bool isLastPart;
- Array<char> * data;
-
- Pair<int64_t int32_t> * partId;
- Pair<int64_t, int64_t> * commitId;
-
- public:
- CommitPart(Slot *s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, Array<char>* _data, bool _isLastPart);
+ bool fldisLastPart;
+ Array<char> *data;
+
+ Pair<int64_t, int32_t> *partId;
+ Pair<int64_t, int64_t> *commitId;
+
+public:
+ CommitPart(Slot *s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, Array<char> *_data, bool _isLastPart);
int getSize();
void setSlot(Slot *s);
int getPartNumber();
int getDataSize();
- Array<char> * getData();
- Pair<int64_t int32_t> * getPartId();
- Pair<int64_t, int64_t> * getCommitId();
+ Array<char> *getData();
+ Pair<int64_t, int32_t> *getPartId();
+ Pair<int64_t, int64_t> *getCommitId();
bool isLastPart();
int64_t getMachineId();
int64_t getTransactionSequenceNumber();
int64_t getSequenceNumber();
void encode(ByteBuffer *bb);
char getType();
- Entry* getCopy(Slot *s);
+ Entry *getCopy(Slot *s);
};
-Entry * CommitPart_decode(Slot * s, ByteBuffer *bb);
+Entry *CommitPart_decode(Slot *s, ByteBuffer *bb);
#endif