Class CommitTransactionPayload
- java.lang.Object
-
- org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload
-
- org.opendaylight.controller.cluster.raft.protobuff.client.messages.IdentifiablePayload<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier>
-
- org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload
-
- All Implemented Interfaces:
Serializable,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier>
@Beta public abstract class CommitTransactionPayload extends org.opendaylight.controller.cluster.raft.protobuff.client.messages.IdentifiablePayload<org.opendaylight.controller.cluster.access.concepts.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map.Entry<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion>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.static @NonNull CommitTransactionPayloadcreate(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate)static @NonNull CommitTransactionPayloadcreate(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate, PayloadVersion version)static @NonNull CommitTransactionPayloadcreate(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate, PayloadVersion version, int initialSerializedBufferCapacity)@NonNull Map.Entry<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion>getCandidate()@NonNull Map.Entry<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion>getCandidate(org.opendaylight.yangtools.yang.data.api.schema.stream.ReusableStreamReceiver receiver)org.opendaylight.controller.cluster.access.concepts.TransactionIdentifiergetIdentifier()StringtoString()
-
-
-
Method Detail
-
create
public static @NonNull CommitTransactionPayload create(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate, PayloadVersion version, int initialSerializedBufferCapacity) throws IOException
- Throws:
IOException
-
create
public static @NonNull CommitTransactionPayload create(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate, PayloadVersion version) throws IOException
- Throws:
IOException
-
create
public static @NonNull CommitTransactionPayload create(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier transactionId, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate candidate) throws IOException
- Throws:
IOException
-
getCandidate
public @NonNull Map.Entry<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion> getCandidate() throws IOException
- Throws:
IOException
-
getCandidate
public final @NonNull Map.Entry<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier,DataTreeCandidateInputOutput.DataTreeCandidateWithVersion> getCandidate(org.opendaylight.yangtools.yang.data.api.schema.stream.ReusableStreamReceiver receiver) throws IOException
- Throws:
IOException
-
getIdentifier
public org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier getIdentifier()
- Specified by:
getIdentifierin interfaceorg.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier>
-
acquireCandidate
public Map.Entry<org.opendaylight.controller.cluster.access.concepts.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
-
-