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 TypeMethodDescriptionboolean
getData()
Returns the payload/data to be replicated.int
hashCode()
long
index()
Returns the index of the entry.boolean
Checks if persistence is pending for this entry.int
Return the estimate of serialized size of this entry when passed through serialization.void
setPersistencePending
(boolean pending) Sets whether or not persistence is pending for this entry.int
size()
Returns the size of the entry in bytes.long
term()
Returns the term of the entry.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:ReplicatedLogEntry
Returns the payload/data to be replicated.- Specified by:
getData
in interfaceReplicatedLogEntry
- Returns:
- the payload/data
-
index
public long index()Description copied from interface:RaftEntryMeta
Returns the index of the entry.- Specified by:
index
in interfaceRaftEntryMeta
- Returns:
- the index
-
term
public long term()Description copied from interface:RaftEntryMeta
Returns the term of the entry.- Specified by:
term
in interfaceRaftEntryMeta
- Returns:
- the term
-
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.
-
setPersistencePending
public void setPersistencePending(boolean pending) Description copied from interface:ReplicatedLogEntry
Sets whether or not persistence is pending for this entry.- Specified by:
setPersistencePending
in interfaceReplicatedLogEntry
- Parameters:
pending
- the new setting.
-
hashCode
public int hashCode() -
equals
-
toString
-