Class SimpleReplicatedLogEntry
java.lang.Object
org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry
- All Implemented Interfaces:
Serializable,RaftEntryMeta,ReplicatedLogEntry
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 TypeMethodDescriptionbooleangetData()Returns the payload/data to be replicated.inthashCode()longindex()Returns the index of the entry.booleanChecks if persistence is pending for this entry.intReturn the estimate of serialized size of this entry when passed through serialization.voidsetPersistencePending(boolean pending) Sets whether or not persistence is pending for this entry.intsize()Returns the size of the entry in bytes.longterm()Returns the term of the entry.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opendaylight.controller.cluster.raft.ReplicatedLogEntry
getIndex, getTerm
-
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
-
index
public long index()Description copied from interface:RaftEntryMetaReturns the index of the entry.- Specified by:
indexin interfaceRaftEntryMeta- Returns:
- the index
-
term
public long term()Description copied from interface:RaftEntryMetaReturns the term of the entry.- Specified by:
termin interfaceRaftEntryMeta- Returns:
- the term
-
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.
-
setPersistencePending
public 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.
-
hashCode
public int hashCode() -
equals
-
toString
-