Class Payload
java.lang.Object
org.opendaylight.controller.cluster.raft.messages.Payload
- All Implemented Interfaces:
Serializable
,StateMachineCommand
,Immutable
- Direct Known Subclasses:
AbstractRaftCommand
,AbstractStateCommand
public abstract sealed class Payload
extends Object
implements StateMachineCommand, Serializable
permits AbstractRaftCommand, AbstractStateCommand
An instance of a
Payload
class is meant to be used as the Payload for AppendEntries
.
When an actor which is derived from RaftActor attempts to persistData it must pass an instance of the Payload class. Similarly when state needs to be applied to the derived RaftActor it will be passed an instance of the Payload class.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opendaylight.controller.cluster.raft.spi.StateMachineCommand
StateMachineCommand.Reader<T extends StateMachineCommand>, StateMachineCommand.Support<T extends StateMachineCommand>, StateMachineCommand.Writer<T extends StateMachineCommand>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
Return the estimate of serialized size of this payload when passed through serialization.abstract int
size()
Return the estimate of in-memory size of this payload.final Payload
Returns theSerializable
form.protected abstract Object
Return the serialization proxy for this object.
-
Constructor Details
-
Payload
public Payload()
-
-
Method Details
-
size
public abstract int size()Return the estimate of in-memory size of this payload.- Returns:
- An estimate of the in-memory size of this payload.
-
serializedSize
public abstract int serializedSize()Return 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.- Returns:
- An estimate of serialized size.
-
toSerialForm
Description copied from interface:StateMachineCommand
Returns theSerializable
form. Returned object mustreadResolve()
into an equivalent object.- Specified by:
toSerialForm
in interfaceStateMachineCommand
- Returns:
- the
Serializable
form
-
writeReplace
Return the serialization proxy for this object.- Returns:
- Serialization proxy
-