b70eace11c835dc8beccb75e7c6b77ae922683c7
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / Payload.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.raft.messages;
9
10 /**
11  * An instance of a {@link Payload} class is meant to be used as the Payload for {@link AppendEntries}.
12  *
13  * <p>
14  * When an actor which is derived from RaftActor attempts to persistData it must pass an instance of the Payload class.
15  * Similarly when state needs to be applied to the derived RaftActor it will be passed an instance of the Payload class.
16  */
17 public abstract class Payload {
18     /**
19      * Return the estimate of in-memory size of this payload.
20      *
21      * @return An estimate of the in-memory size of this payload.
22      */
23     public abstract int size();
24 }