X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FNoopRaftActorSnapshotCohort.java;fp=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FNoopRaftActorSnapshotCohort.java;h=42b226f2af71ac50464b53368f09d40c2770c6b8;hb=2faf656bf68dd3843fd59520b27a7ec2abbdcc68;hp=0000000000000000000000000000000000000000;hpb=d04b71990a802071a786fe8f0df57bc4adbdec3f;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java new file mode 100644 index 0000000000..42b226f2af --- /dev/null +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Brocade Communications Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.cluster.raft; + +import akka.actor.ActorRef; +import com.google.common.io.ByteSource; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Optional; +import org.opendaylight.controller.cluster.raft.persisted.EmptyState; +import org.opendaylight.controller.cluster.raft.persisted.Snapshot.State; + +/** + * RaftActorSnapshotCohort implementation that does nothing. + * + * @author Thomas Pantelis + */ +public final class NoopRaftActorSnapshotCohort implements RaftActorSnapshotCohort { + public static final NoopRaftActorSnapshotCohort INSTANCE = new NoopRaftActorSnapshotCohort(); + + private NoopRaftActorSnapshotCohort() { + } + + @Override + public void createSnapshot(ActorRef actorRef, Optional installSnapshotStream) { + } + + @Override + public void applySnapshot(State snapshotState) { + } + + @Override + public State deserializeSnapshot(ByteSource snapshotBytes) throws IOException { + return EmptyState.INSTANCE; + } +}