- public void applySnapshot(final byte[] snapshotBytes) {
- // Since this will be done only on Recovery or when this actor is a Follower
- // we can safely commit everything in here. We not need to worry about event notifications
- // as they would have already been disabled on the follower
-
- log.info("{}: Applying snapshot", logId);
- deserializeAndApplySnapshot(snapshotBytes);
- log.info("{}: Done applying snapshot", logId);
+ public State deserializeSnapshot(final ByteSource snapshotBytes) throws IOException {
+ try (ObjectInputStream in = new ObjectInputStream(snapshotBytes.openStream())) {
+ return new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(in));
+ }