+abstract class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
+ private static final class Simple extends ShardRecoveryCoordinator {
+ Simple(final ShardDataTree store, final String shardName, final Logger log) {
+ super(store, shardName, log);
+ }
+
+ @Override
+ public Snapshot getRestoreFromSnapshot() {
+ return null;
+ }
+ }
+
+ private static final class WithSnapshot extends ShardRecoveryCoordinator {
+ private final Snapshot restoreFromSnapshot;
+
+ WithSnapshot(final ShardDataTree store, final String shardName, final Logger log, final Snapshot snapshot) {
+ super(store, shardName, log);
+ this.restoreFromSnapshot = requireNonNull(snapshot);
+ }
+
+ @Override
+ public Snapshot getRestoreFromSnapshot() {
+ return restoreFromSnapshot;
+ }
+ }
+