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
.boolean
int
hashCode()
long
index()
Returns the index of the entry.boolean
Checks if persistence is pending for this entry.static SimpleReplicatedLogEntry
int
Return the estimate of serialized size of this entry when passed through serialization.int
size()
Returns the size of the entry in bytes.long
term()
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:LogEntry
Returns this entry'sStateMachineCommand
.- Specified by:
command
in interfaceLogEntry
- Specified by:
command
in interfaceReplicatedLogEntry
- Returns:
- this entry's
StateMachineCommand
-
index
public long index()Description copied from interface:EntryMeta
Returns the index of the entry. -
term
public long term()Description copied from interface:EntryMeta
Returns the term of the entry. -
size
public int size()Description copied from interface:ReplicatedLogEntry
Returns the size of the entry in bytes. An approximate number may be good enough.- Specified by:
size
in interfaceReplicatedLogEntry
- Returns:
- the size of the entry in bytes.
-
serializedSize
public int serializedSize()Description copied from interface:ReplicatedLogEntry
Return 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:
serializedSize
in interfaceReplicatedLogEntry
- Returns:
- An estimate of serialized size.
-
isPersistencePending
public boolean isPersistencePending()Description copied from interface:ReplicatedLogEntry
Checks if persistence is pending for this entry.- Specified by:
isPersistencePending
in interfaceReplicatedLogEntry
- Returns:
- true if persistence is pending, false otherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-