ca251d2818a693ba1d0a903836ed3a5294601216
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / ApplyJournalEntries.java
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. 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.base.messages;
9
10 import java.io.Serializable;
11
12 /**
13  * This is an internal message that is stored in the akka's persistent journal. During recovery, this
14  * message is used to apply recovered journal entries to the state whose indexes range from the context's
15  * current lastApplied index to "toIndex" contained in the message. This message is sent internally from a
16  * behavior to the RaftActor to persist.
17  *
18  * @author Thomas Pantelis
19  */
20 public class ApplyJournalEntries implements Serializable {
21     private static final long serialVersionUID = 1L;
22
23     private final long toIndex;
24
25     public ApplyJournalEntries(long toIndex) {
26         this.toIndex = toIndex;
27     }
28
29     public long getToIndex() {
30         return toIndex;
31     }
32
33     @Override
34     public String toString() {
35         StringBuilder builder = new StringBuilder();
36         builder.append("ApplyJournalEntries [toIndex=").append(toIndex).append("]");
37         return builder.toString();
38     }
39 }