Vladsz83 commented on code in PR #13577:
URL: https://github.com/apache/ignite/pull/13577#discussion_r4145809382


##########
modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotDeleteTask.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.management.snapshot;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.internal.IgniteEx;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDeleteProcess;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDeleteProcessResult;
+import org.apache.ignite.internal.processors.task.GridInternal;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.internal.visor.VisorOneNodeTask;
+import org.apache.ignite.internal.visor.VisorTaskArgument;
+import org.apache.ignite.resources.IgniteInstanceResource;
+
+import static 
org.apache.ignite.internal.processors.rollingupgrade.feature.SupportedFeatureRegistry.SNAPSHOT_DELETE_FEATURE;
+
+/**
+ * @see IgniteSnapshotManager#deleteSnapshot(String, String)
+ * @see SnapshotDeleteProcess
+ */
+@GridInternal
+public class SnapshotDeleteTask extends 
VisorOneNodeTask<SnapshotDeleteCommandArg, SnapshotDeleteProcessResult> {
+    /** Serial version uid. */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    @IgniteInstanceResource
+    private IgniteEx ignite;
+
+    /** {@inheritDoc} */
+    @Override protected VisorJob<SnapshotDeleteCommandArg, 
SnapshotDeleteProcessResult> job(SnapshotDeleteCommandArg arg) {
+        return new SnapshotDeleteJob(arg, debug);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Collection<UUID> 
jobNodes(VisorTaskArgument<SnapshotDeleteCommandArg> arg) {
+        return super.jobNodes(arg);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Map<? extends ComputeJob, ClusterNode> map0(
+        List<ClusterNode> subgrid,
+        VisorTaskArgument<SnapshotDeleteCommandArg> arg
+    ) {
+        if 
(!ignite.context().rollingUpgrade().features().isActive(SNAPSHOT_DELETE_FEATURE))

Review Comment:
   > 2. Here `SnapshotDeleteTask#map0` you can filter client nodes and remove 
such code from : `SnapshotDeleteProcess#deletePhase` mean this check:
   > 
   > ```
   >         if (kctx.cluster().get().localNode().isClient())
   >             return new GridFinishedFuture<>(new SnapshotDeleteResponse());
   > ```
   > 
   > and yes - you wll reduce operations call with such approach
   
   It maps where task/job can work. The DP will come to client nodes 
regardless. I doubt it would work or would bring notable benefits.
   
   



##########
modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotDeleteTask.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.management.snapshot;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.internal.IgniteEx;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDeleteProcess;
+import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDeleteProcessResult;
+import org.apache.ignite.internal.processors.task.GridInternal;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.internal.visor.VisorOneNodeTask;
+import org.apache.ignite.internal.visor.VisorTaskArgument;
+import org.apache.ignite.resources.IgniteInstanceResource;
+
+import static 
org.apache.ignite.internal.processors.rollingupgrade.feature.SupportedFeatureRegistry.SNAPSHOT_DELETE_FEATURE;
+
+/**
+ * @see IgniteSnapshotManager#deleteSnapshot(String, String)
+ * @see SnapshotDeleteProcess
+ */
+@GridInternal
+public class SnapshotDeleteTask extends 
VisorOneNodeTask<SnapshotDeleteCommandArg, SnapshotDeleteProcessResult> {
+    /** Serial version uid. */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    @IgniteInstanceResource
+    private IgniteEx ignite;
+
+    /** {@inheritDoc} */
+    @Override protected VisorJob<SnapshotDeleteCommandArg, 
SnapshotDeleteProcessResult> job(SnapshotDeleteCommandArg arg) {
+        return new SnapshotDeleteJob(arg, debug);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Collection<UUID> 
jobNodes(VisorTaskArgument<SnapshotDeleteCommandArg> arg) {
+        return super.jobNodes(arg);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Map<? extends ComputeJob, ClusterNode> map0(
+        List<ClusterNode> subgrid,
+        VisorTaskArgument<SnapshotDeleteCommandArg> arg
+    ) {
+        if 
(!ignite.context().rollingUpgrade().features().isActive(SNAPSHOT_DELETE_FEATURE))

Review Comment:
   Done ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to