Class 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 the DataTreeCandidate
    Author:
    Robert Varga
    See Also:
    Serialized Form
    • 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
      • getIdentifier

        public org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier getIdentifier()
        Specified by:
        getIdentifier in interface org.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