Class SimpleReplicatedLogEntry
java.lang.Object
org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry
- All Implemented Interfaces:
Serializable,ReplicatedLogEntry,LogEntry,EntryMeta
@NonNullByDefault
public final class SimpleReplicatedLogEntry
extends Object
implements ReplicatedLogEntry, Serializable
A
ReplicatedLogEntry implementation.- Author:
- Thomas Pantelis
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleReplicatedLogEntry(long index, long term, Payload payload) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns this entry'sStateMachineCommand.booleaninthashCode()longindex()Returns the index of the entry.booleanChecks if persistence is pending for this entry.static SimpleReplicatedLogEntryintReturn the estimate of serialized size of this entry when passed through serialization.intsize()Returns the size of the entry in bytes.longterm()Returns the term of the entry.toString()
-
Constructor Details
-
SimpleReplicatedLogEntry
Constructs an instance.- Parameters:
index- the indexterm- the termpayload- the payload
-
-
Method Details
-
of
-
command
Description copied from interface:LogEntryReturns this entry'sStateMachineCommand.- Specified by:
commandin interfaceLogEntry- Specified by:
commandin interfaceReplicatedLogEntry- Returns:
- this entry's
StateMachineCommand
-
index
public long index()Description copied from interface:EntryMetaReturns the index of the entry. -
term
public long term()Description copied from interface:EntryMetaReturns the term of the entry. -
size
public int size()Description copied from interface:ReplicatedLogEntryReturns the size of the entry in bytes. An approximate number may be good enough.- Specified by:
sizein interfaceReplicatedLogEntry- Returns:
- the size of the entry in bytes.
-
serializedSize
public int serializedSize()Description copied from interface:ReplicatedLogEntryReturn the estimate of serialized size of this entry 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 interfaceReplicatedLogEntry- Returns:
- An estimate of serialized size.
-
isPersistencePending
public boolean isPersistencePending()Description copied from interface:ReplicatedLogEntryChecks if persistence is pending for this entry.- Specified by:
isPersistencePendingin interfaceReplicatedLogEntry- Returns:
- true if persistence is pending, false otherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-