2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.raft;
11 * The state of the followers log as known by the Leader
13 public interface FollowerLogInformation {
16 * Increment the value of the nextIndex
22 * Decrement the value of the nextIndex
28 * Sets the index of the next log entry for this follower.
31 * @return true if the new index differed from the current index and the current index was updated, false
34 boolean setNextIndex(long nextIndex);
37 * Increment the value of the matchIndex
40 long incrMatchIndex();
43 * Sets the index of the highest log entry for this follower.
46 * @return true if the new index differed from the current index and the current index was updated, false
49 boolean setMatchIndex(long matchIndex);
52 * The identifier of the follower
53 * This could simply be the url of the remote actor
58 * for each server, index of the next log entry
59 * to send to that server (initialized to leader
65 * for each server, index of highest log entry
66 * known to be replicated on server
67 * (initialized to 0, increases monotonically)
72 * Checks if the follower is active by comparing the last updated with the duration
75 boolean isFollowerActive();
78 * restarts the timeout clock of the follower
80 void markFollowerActive();
83 * This will stop the timeout clock
85 void markFollowerInActive();
89 * This will return the active time of follower, since it was last reset
90 * @return time in milliseconds
92 long timeSinceLastActivity();
95 * This method checks if it is ok to replicate
97 * @return true if it is ok to replicate
99 boolean okToReplicate();