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
31 void setNextIndex(long nextIndex);
34 * Increment the value of the matchIndex
37 long incrMatchIndex();
39 void setMatchIndex(long matchIndex);
42 * The identifier of the follower
43 * This could simply be the url of the remote actor
48 * for each server, index of the next log entry
49 * to send to that server (initialized to leader
55 * for each server, index of highest log entry
56 * known to be replicated on server
57 * (initialized to 0, increases monotonically)
62 * Checks if the follower is active by comparing the last updated with the duration
65 boolean isFollowerActive();
68 * restarts the timeout clock of the follower
70 void markFollowerActive();
73 * This will stop the timeout clock
75 void markFollowerInActive();
79 * This will return the active time of follower, since it was last reset
80 * @return time in milliseconds
82 long timeSinceLastActivity();