public class CollectionTransactionLogRecord extends Object implements TransactionLogRecord
Modifier and Type | Field and Description |
---|---|
protected String |
name |
protected List<Operation> |
operationList |
protected int |
partitionId |
protected String |
serviceName |
protected String |
transactionId |
Constructor and Description |
---|
CollectionTransactionLogRecord() |
CollectionTransactionLogRecord(String serviceName,
String transactionId,
String name,
int partitionId) |
Modifier and Type | Method and Description |
---|---|
void |
addOperation(CollectionTxnOperation operation) |
protected long[] |
createItemIdArray()
Creates an array of IDs for all operations in this transaction log.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
getKey()
Gets the transaction-log-key that uniquely identifies the
TransactionLogRecord within the TransactionLog . |
Operation |
newCommitOperation() |
Operation |
newPrepareOperation() |
Operation |
newRollbackOperation() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
int |
removeOperation(long itemId) |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
protected String name
protected int partitionId
protected String transactionId
protected String serviceName
public Operation newPrepareOperation()
newPrepareOperation
in interface TransactionLogRecord
public Operation newCommitOperation()
newCommitOperation
in interface TransactionLogRecord
public Operation newRollbackOperation()
newRollbackOperation
in interface TransactionLogRecord
public Object getKey()
TransactionLogRecord
TransactionLogRecord
within the TransactionLog
.
E.g. for a map that would be the map-name and the key. So if a map transactional put is done on some
key, and if later on another put on that key is done, by using the same transaction-log-key, the first
put is overwritten.
If null is returned, this TransactionLogRecord can't be identified and can't be overwritten by a later change.getKey
in interface TransactionLogRecord
public void addOperation(CollectionTxnOperation operation)
public int removeOperation(long itemId)
protected long[] createItemIdArray()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.