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