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++);
}
} else {
- super.onReceiveCommand(message);
+ super.handleNonRaftCommand(message);
}
}
}
}
- private ByteString fromObject(Object snapshot) throws Exception {
+ private static ByteString fromObject(Object snapshot) throws Exception {
ByteArrayOutputStream b = null;
ObjectOutputStream o = null;
try {
}
}
- 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;
}
- @Override public void onReceiveRecover(Object message)throws Exception {
- super.onReceiveRecover(message);
- }
-
@Override public String persistenceId() {
return getId();
}
protected RaftActorSnapshotCohort getRaftActorSnapshotCohort() {
return this;
}
+
+ @Override
+ public byte[] getRestoreFromSnapshot() {
+ return null;
+ }
}