X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FReplicatedLogEntry.java;h=360f6b690376c1c413b1a2f04bc8a7e946400758;hb=537c44438b1e8854b719903ac2a4a0d5e12d6606;hp=1348ffca9163adf786d4f715fce3ddf858605548;hpb=fa96da71c5ab10973a9f93c2e8b35494b96fd7ed;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLogEntry.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLogEntry.java index 1348ffca91..360f6b6903 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLogEntry.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLogEntry.java @@ -8,7 +8,7 @@ package org.opendaylight.controller.cluster.raft; -import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload; +import org.opendaylight.controller.cluster.raft.messages.Payload; /** * Represents one entry in the replicated log. @@ -42,6 +42,15 @@ public interface ReplicatedLogEntry { */ int size(); + /** + * 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. + * + * @return An estimate of serialized size. + */ + int serializedSize(); + /** * Checks if persistence is pending for this entry. *