-
-class TransactionPart extends Entry {
-
- // Max size of the part excluding the fixed size header
- static final int MAX_NON_HEADER_SIZE = 512;
-
- int64_t sequenceNumber = -1;
- int64_t machineId = -1;
- int64_t arbitratorId = -1;
- int64_t clientLocalSequenceNumber = -1; // Sequence number of the transaction that this is a part of
- int partNumber = -1; // Parts position in the
- bool isLastPart = false;
-
- Pair<int64_t, int64_t> transactionId = NULL;
- Pair<int64_t int32_t> partId = NULL;
-
- char[] data = NULL;
-
- TransactionPart(Slot s, int64_t _machineId, int64_t _arbitratorId, int64_t _clientLocalSequenceNumber, int _partNumber, char[] _data, bool _isLastPart) {
- super(s);
- machineId = _machineId;
- arbitratorId = _arbitratorId;
- clientLocalSequenceNumber = _clientLocalSequenceNumber;
- partNumber = _partNumber;
- data = _data;
- isLastPart = _isLastPart;
-
- transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
- partId = new Pair<int64_t int32_t>(clientLocalSequenceNumber, partNumber);
-
- }
-
- int getSize() {
- if (data == NULL) {
- return (4 * sizeof(int64_t)) + (2 * sizeof(int32_t)) + (2 * sizeof(char));
- }
- return (4 * sizeof(int64_t)) + (2 * sizeof(int32_t)) + (2 * sizeof(char)) + data.length;