Vladsz83 commented on code in PR #11897: URL: https://github.com/apache/ignite/pull/11897#discussion_r2301543389
########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotHandlerRestoreTask.java: ########## @@ -26,53 +26,69 @@ import java.util.UUID; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; -import org.apache.ignite.compute.ComputeJobResult; -import org.apache.ignite.internal.util.typedef.F; -import org.jetbrains.annotations.Nullable; +import org.apache.ignite.IgniteLogger; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.cache.persistence.filename.SnapshotFileTree; /** * Snapshot restore operation handling task. */ -public class SnapshotHandlerRestoreTask extends AbstractSnapshotVerificationTask { - /** Serial version uid. */ - private static final long serialVersionUID = 0L; - - /** {@inheritDoc} */ - @Override protected SnapshotHandlerRestoreJob createJob( - String name, - String folderName, - String consId, - SnapshotPartitionsVerifyTaskArg args +public class SnapshotHandlerRestoreTask { + /** */ + private final IgniteEx ignite; + + /** */ + private final IgniteLogger log; + + /** */ + private final SnapshotHandlerRestoreJob job; + + /** */ + SnapshotHandlerRestoreTask( + IgniteEx ignite, + IgniteLogger log, + SnapshotFileTree sft, + Collection<String> grps, + boolean check ) { - return new SnapshotHandlerRestoreJob(name, args.snapshotPath(), folderName, consId, args.cacheGroupNames(), args.check()); + job = new SnapshotHandlerRestoreJob(ignite, sft, grps, check); + this.ignite = ignite; + this.log = log; } - /** {@inheritDoc} */ - @SuppressWarnings("rawtypes") - @Nullable @Override public SnapshotPartitionsVerifyTaskResult reduce(List<ComputeJobResult> results) { + /** */ + public Map<String, SnapshotHandlerResult<Object>> execute() { + return job.execute0(); + } + + /** */ + public void reduce( + String snapshotName, + Map<ClusterNode, Map<Object, Map<String, SnapshotHandlerResult<?>>>> results + ) { Map<String, List<SnapshotHandlerResult<?>>> clusterResults = new HashMap<>(); Collection<UUID> execNodes = new ArrayList<>(results.size()); - for (ComputeJobResult res : results) { - if (res.getException() != null) - throw res.getException(); + // Checking node -> Map by snapshot part's consistend id. Review Comment: Suggestion: Actually, `snapshot part's` is a bit confusing. What is `snapshot part`? Part of work? Let's just keep `per consistent id`. The same in other places. Just search for the phrase -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org