ac1d0globlya commented on code in PR #12547:
URL: https://github.com/apache/ignite/pull/12547#discussion_r2580190130
##########
modules/core/src/main/java/org/apache/ignite/internal/management/checkpoint/CheckpointForceTask.java:
##########
@@ -0,0 +1,74 @@
+package org.apache.ignite.internal.management.checkpoint;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.cache.persistence.CheckpointState;
+import
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
+import
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.internal.visor.VisorMultiNodeTask;
+import org.jetbrains.annotations.Nullable;
+
+/** Checkpoint force task. */
+public class CheckpointForceTask extends
VisorMultiNodeTask<CheckpointForceCommandArg, String, String> {
+ /** */
+ private static final long serialVersionUID = 0;
+
+ /** {@inheritDoc} */
+ @Override protected VisorJob<CheckpointForceCommandArg, String>
job(CheckpointForceCommandArg arg) {
+ return new CheckpointForceJob(arg, false);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected @Nullable String reduce0(List<ComputeJobResult>
results) throws IgniteException {
+ for (ComputeJobResult res : results) {
+ if (res.getException() != null)
+ throw res.getException();
+ }
+
+ return "Checkpoint triggered on all nodes";
+ }
+
+ /** Checkpoint force job. */
+ private static class CheckpointForceJob extends
VisorJob<CheckpointForceCommandArg, String> {
+ /** */
+ private static final long serialVersionUID = 0;
+
+ /** */
+ protected CheckpointForceJob(@Nullable CheckpointForceCommandArg arg,
boolean debug) {
+ super(arg, debug);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected String run(@Nullable CheckpointForceCommandArg
arg) throws IgniteException {
Review Comment:
We must check if persistence enabled on node with the:
```
if (!CU.isPersistenceEnabled(ignite.configuration())) {
throw new IgniteException("Can't checkpoint on in-memory
node"); // Or return some result here.
}
```
--
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]