-class CommitPart extends Entry{
-
- // Max size of the part excluding the fixed size header
- static final int MAX_NON_HEADER_SIZE = 512;
-
-
- // Sequence number of the transaction this commit is for, -1 if not a cloud transaction
- int64_t machineId = -1; // Machine Id of the device that made the commit
- int64_t sequenceNumber = -1; // commit sequence number for this arbitrator
- int64_t transactionSequenceNumber = -1;
- int partNumber = -1; // Parts position in the
- Boolean isLastPart = false;
- char[] data = NULL;
-
- Pair<Long, Integer> partId = NULL;
- Pair<Long, Long> commitId = NULL;
-
-
- CommitPart(Slot s, int64_t _machineId, int64_t _sequenceNumber, int64_t _transactionSequenceNumber, int _partNumber, char[] _data, Boolean _isLastPart) {
- super(s);
- machineId = _machineId;
- sequenceNumber = _sequenceNumber;
- transactionSequenceNumber = _transactionSequenceNumber;
- partNumber = _partNumber;
- isLastPart = _isLastPart;
- data = _data;
-
- partId = new Pair<Long, Integer>(sequenceNumber, partNumber);
- commitId = new Pair<Long, Long>(machineId, sequenceNumber);
- }
-
- int getSize() {
- if (data == NULL) {
- return (3 * sizeof(int64_t)) + (2 * sizeof(int32_t)) + (2 * sizeof(char));
- }
- return (3 * sizeof(int64_t)) + (2 * sizeof(int32_t)) + (2 * sizeof(char)) + data.length;
- }
-
- void setSlot(Slot s) {
- parentslot = s;
- }