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 akka.actor.ActorRef;
12 import akka.actor.ActorSelection;
13 import akka.actor.Props;
15 import java.util.concurrent.atomic.AtomicLong;
18 * The RaftActorContext contains that portion of the RaftActors state that
19 * needs to be shared with it's behaviors. A RaftActorContext should NEVER be
20 * used in any actor context outside the RaftActor that constructed it.
22 public interface RaftActorContext {
24 * Create a new local actor
28 ActorRef actorOf(Props props);
31 * Create a actor selection
35 ActorSelection actorSelection(String path);
38 * Get the identifier for the RaftActor. This identifier represents the
39 * name of the actor whose common state is being shared. For example the
40 * id could be 'inventory'
41 * @return the identifier
46 * A reference to the RaftActor itself. This could be used to send messages
53 * Get the ElectionTerm information
56 ElectionTerm getTermInformation();
59 * index of highest log entry known to be
60 * committed (initialized to 0, increases
64 AtomicLong getCommitIndex();
67 * index of highest log entry applied to state
68 * machine (initialized to 0, increases
72 AtomicLong getLastApplied();
77 ReplicatedLog getReplicatedLog();