Interface ReplicatedLogEntry
-
- All Known Implementing Classes:
SimpleReplicatedLogEntry
public interface ReplicatedLogEntryRepresents one entry in the replicated log.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PayloadgetData()Returns the payload/data to be replicated.longgetIndex()Returns the index of the entry.longgetTerm()Returns the term of the entry.booleanisPersistencePending()Checks if persistence is pending for this entry.intserializedSize()Return 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.
-
-
-
Method Detail
-
getData
Payload getData()
Returns the payload/data to be replicated.- Returns:
- the payload/data
-
getTerm
long getTerm()
Returns the term of the entry.- Returns:
- the term
-
getIndex
long getIndex()
Returns the index of the entry.- Returns:
- the index
-
size
int size()
Returns the size of the entry in bytes. An approximate number may be good enough.- Returns:
- the size of the entry in bytes.
-
serializedSize
int serializedSize()
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.- Returns:
- An estimate of serialized size.
-
isPersistencePending
boolean isPersistencePending()
Checks if persistence is pending for this entry.- Returns:
- true if persistence is pending, false otherwise.
-
setPersistencePending
void setPersistencePending(boolean pending)
Sets whether or not persistence is pending for this entry.- Parameters:
pending- the new setting.
-
-