Class CommitTransactionPayload
java.lang.Object
org.opendaylight.controller.cluster.raft.messages.Payload
org.opendaylight.controller.cluster.raft.messages.IdentifiablePayload<TransactionIdentifier>
org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload
- All Implemented Interfaces:
Serializable,Identifiable<TransactionIdentifier>
@Beta
public abstract sealed class CommitTransactionPayload
extends IdentifiablePayload<TransactionIdentifier>
implements Serializable
Payload persisted when a transaction commits. It contains the transaction identifier and the
DataTreeCandidate- Author:
- Robert Varga
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record -
Method Summary
Modifier and TypeMethodDescriptionThe cached candidate needs to be cleared after it is done applying to the DataTree, otherwise it would be keeping deserialized in memory which are not needed anymore leading to wasted memory.static @NonNull CommitTransactionPayloadcreate(TransactionIdentifier transactionId, DataTreeCandidate candidate) static @NonNull CommitTransactionPayloadcreate(TransactionIdentifier transactionId, DataTreeCandidate candidate, PayloadVersion version) static @NonNull CommitTransactionPayloadcreate(TransactionIdentifier transactionId, DataTreeCandidate candidate, PayloadVersion version, int initialSerializedBufferCapacity) final @NonNull CommitTransactionPayload.CandidateTransactiongetCandidate(ReusableStreamReceiver receiver) final intReturn the estimate of serialized size of this payload when passed through serialization.final StringtoString()final ObjectReturn the serialization proxy for this object.
-
Method Details
-
create
public static @NonNull CommitTransactionPayload create(TransactionIdentifier transactionId, DataTreeCandidate candidate, PayloadVersion version, int initialSerializedBufferCapacity) throws IOException - Throws:
IOException
-
create
public static @NonNull CommitTransactionPayload create(TransactionIdentifier transactionId, DataTreeCandidate candidate, PayloadVersion version) throws IOException - Throws:
IOException
-
create
public static @NonNull CommitTransactionPayload create(TransactionIdentifier transactionId, DataTreeCandidate candidate) throws IOException - Throws:
IOException
-
getCandidate
- Throws:
IOException
-
getCandidate
public final @NonNull CommitTransactionPayload.CandidateTransaction getCandidate(ReusableStreamReceiver receiver) throws IOException - Throws:
IOException
-
getIdentifier
- Specified by:
getIdentifierin interfaceIdentifiable<TransactionIdentifier>
-
serializedSize
public final int serializedSize()Description copied from class:PayloadReturn the estimate of serialized size of this payload when passed through serialization. The estimate needs to be reasonably accurate and should err on the side of caution and report a slightly-higher size in face of uncertainty.- Specified by:
serializedSizein classPayload- Returns:
- An estimate of serialized size.
-
acquireCandidate
The cached candidate needs to be cleared after it is done applying to the DataTree, otherwise it would be keeping deserialized in memory which are not needed anymore leading to wasted memory. This lets the payload know that this was the last time the candidate was needed ant it is safe to be cleared.- Throws:
IOException
-
toString
-
writeReplace
Description copied from class:PayloadReturn the serialization proxy for this object.- Specified by:
writeReplacein classPayload- Returns:
- Serialization proxy
-