Class SimpleReplicatedLogEntry
java.lang.Object
org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry
- All Implemented Interfaces:
Serializable,ReplicatedLogEntry
public sealed 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 TypeMethodDescriptionfinal booleanfinal PayloadgetData()Returns the payload/data to be replicated.final longgetIndex()Returns the index of the entry.final longgetTerm()Returns the term of the entry.final inthashCode()final booleanChecks if persistence is pending for this entry.final intReturn the estimate of serialized size of this entry when passed through serialization.final voidsetPersistencePending(boolean pending) Sets whether or not persistence is pending for this entry.final intsize()Returns the size of the entry in bytes.final StringtoString()final Object
-
Constructor Details
-
SimpleReplicatedLogEntry
Constructs an instance.- Parameters:
index- the indexterm- the termpayload- the payload
-
-
Method Details
-
getData
Description copied from interface:ReplicatedLogEntryReturns the payload/data to be replicated.- Specified by:
getDatain interfaceReplicatedLogEntry- Returns:
- the payload/data
-
getTerm
public final long getTerm()Description copied from interface:ReplicatedLogEntryReturns the term of the entry.- Specified by:
getTermin interfaceReplicatedLogEntry- Returns:
- the term
-
getIndex
public final long getIndex()Description copied from interface:ReplicatedLogEntryReturns the index of the entry.- Specified by:
getIndexin interfaceReplicatedLogEntry- Returns:
- the index
-
size
public final 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 final 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 final 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.
-
setPersistencePending
public final void setPersistencePending(boolean pending) Description copied from interface:ReplicatedLogEntrySets whether or not persistence is pending for this entry.- Specified by:
setPersistencePendingin interfaceReplicatedLogEntry- Parameters:
pending- the new setting.
-
writeReplace
-
hashCode
public final int hashCode() -
equals
-
toString
-