Initial code/design for an Akka Raft implementation
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / FollowerLogInformation.java
1 /*
2  * Copyright (c) 2014 Cisco 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
9 package org.opendaylight.controller.cluster.raft;
10
11 import java.util.concurrent.atomic.AtomicLong;
12
13 /**
14  * The state of the followers log as known by the Leader
15  */
16 public interface FollowerLogInformation {
17
18     /**
19      * Increment the value of the nextIndex
20      * @return
21      */
22     public long incrNextIndex();
23
24     /**
25      * Increment the value of the matchIndex
26      * @return
27      */
28     public long incrMatchIndex();
29
30     /**
31      * The identifier of the follower
32      * This could simply be the url of the remote actor
33      */
34     public String getId();
35
36     /**
37      * for each server, index of the next log entry
38      * to send to that server (initialized to leader
39      *    last log index + 1)
40      */
41     public AtomicLong getNextIndex();
42
43     /**
44      * for each server, index of highest log entry
45      * known to be replicated on server
46      *    (initialized to 0, increases monotonically)
47      */
48     public AtomicLong getMatchIndex();
49
50
51 }