Move null check from getTotalMemory()
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorSnapshotCohort.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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 package org.opendaylight.controller.cluster.raft;
9
10 import akka.actor.ActorRef;
11
12 /**
13  * Interface for a class that participates in raft actor snapshotting.
14  *
15  * @author Thomas Pantelis
16  */
17 public interface RaftActorSnapshotCohort {
18
19     /**
20      * This method is called by the RaftActor when a snapshot needs to be
21      * created. The implementation should send a CaptureSnapshotReply to the given actor.
22      *
23      * @param actorRef the actor to which to respond
24      */
25     void createSnapshot(ActorRef actorRef);
26
27     /**
28      * This method is called to apply a snapshot installed by the leader.
29      *
30      * @param snapshotBytes a snapshot of the state of the actor
31      */
32     void applySnapshot(byte[] snapshotBytes);
33 }