class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {

    @Override
    @SuppressWarnings("checkstyle:IllegalCatch")
    public void applyRecoverySnapshot(final Snapshot.State snapshotState) {
        if (!(snapshotState instanceof ShardSnapshotState)) {
            log.debug("{}: applyRecoverySnapshot ignoring snapshot: {}", shardName, snapshotState);
            return;
        }

        log.debug("{}: Applying recovered snapshot", shardName);
        final ShardSnapshotState shardSnapshotState = (ShardSnapshotState)snapshotState;
        try {
            store.applyRecoverySnapshot(shardSnapshotState);
        } catch (Exception e) {
            final ShardDataTreeSnapshot shardSnapshot = shardSnapshotState.getSnapshot();
            final File f = writeRoot("snapshot", shardSnapshot.getRootNode().orElse(null));
            throw new IllegalStateException(String.format(
                    "%s: Failed to apply recovery snapshot %s. Node data was written to file %s",
                    shardName, shardSnapshot, f), e);
        }
    }

      ShardRecoveryCoordinator(final ShardDataTree store, final String shardName, final Logger log);

}