X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft-example%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fexample%2FExampleActor.java;h=87dede1086901d3c930be777d3d0fbd8642baa07;hp=3ce8364fcea603647d794bef1c92a6d29def76fa;hb=f276ae33b951d173b51c467bb7bb1a5f5cf9a1e6;hpb=5aa58404a8ee1ad053742780439823309360a3a1 diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java index 3ce8364fce..87dede1086 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java @@ -57,7 +57,8 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, return Props.create(ExampleActor.class, id, peerAddresses, configParams); } - @Override public void onReceiveCommand(Object message) throws Exception{ + @Override + protected void handleNonRaftCommand(Object message) { if(message instanceof KeyValue){ if(isLeader()) { String persistId = Long.toString(persistIdentifier++); @@ -89,7 +90,7 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, } } else { - super.onReceiveCommand(message); + super.handleNonRaftCommand(message); } } @@ -145,7 +146,7 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, } } - private ByteString fromObject(Object snapshot) throws Exception { + private static ByteString fromObject(Object snapshot) throws Exception { ByteArrayOutputStream b = null; ObjectOutputStream o = null; try { @@ -165,7 +166,7 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, } } - private Object toObject(byte [] bs) throws ClassNotFoundException, IOException { + private static Object toObject(byte [] bs) throws ClassNotFoundException, IOException { Object obj = null; ByteArrayInputStream bis = null; ObjectInputStream ois = null; @@ -188,10 +189,6 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, } - @Override public void onReceiveRecover(Object message)throws Exception { - super.onReceiveRecover(message); - } - @Override public String persistenceId() { return getId(); } @@ -226,4 +223,9 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, protected RaftActorSnapshotCohort getRaftActorSnapshotCohort() { return this; } + + @Override + public byte[] getRestoreFromSnapshot() { + return null; + } }