Class CommitTransactionPayload
- java.lang.Object
-
- org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload
-
- org.opendaylight.controller.cluster.raft.protobuff.client.messages.IdentifiablePayload<TransactionIdentifier>
-
- org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload
-
- All Implemented Interfaces:
Serializable
,Identifiable<TransactionIdentifier>
@Beta public abstract class CommitTransactionPayload extends IdentifiablePayload<TransactionIdentifier> implements Serializable
Payload persisted when a transaction commits. It contains the transaction identifier and theDataTreeCandidate
- Author:
- Robert Varga
- See Also:
- Serialized Form
-
-
Method Summary
-
-
-
Method Detail
-
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
public @NonNull Map.Entry<TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion> getCandidate() throws IOException
- Throws:
IOException
-
getCandidate
public final @NonNull Map.Entry<TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion> getCandidate(ReusableStreamReceiver receiver) throws IOException
- Throws:
IOException
-
getIdentifier
public TransactionIdentifier getIdentifier()
- Specified by:
getIdentifier
in interfaceIdentifiable<TransactionIdentifier>
-
acquireCandidate
public Map.Entry<TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion> acquireCandidate() throws IOException
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
-
-