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
9 package org.opendaylight.controller.cluster.raft;
11 import java.util.List;
14 * Represents the ReplicatedLog that needs to be kept in sync by the RaftActor
16 public interface ReplicatedLog {
18 * Get a replicated log entry at the specified index
23 ReplicatedLogEntry get(long index);
27 * Get the last replicated log entry
31 ReplicatedLogEntry last();
46 * Remove all the entries from the logs >= index
50 void removeFrom(long index);
53 * Append an entry to the log
54 * @param replicatedLogEntry
56 void append(ReplicatedLogEntry replicatedLogEntry);
60 * @param replicatedLogEntry
62 void appendAndPersist(final ReplicatedLogEntry replicatedLogEntry);
68 List<ReplicatedLogEntry> getFrom(long index);