From c02609893884f03a37635c381e01457abe367016 Mon Sep 17 00:00:00 2001 From: Ravil Zakirov Date: Fri, 26 Dec 2025 12:42:42 +0300 Subject: [PATCH 1/3] IGNITE-27341 Introduced task name for .Net compute tasks. --- .../platform/compute/PlatformFullTask.java | 5 + .../processors/task/GridTaskProcessor.java | 4 + .../Apache.Ignite.Core/Compute/ICompute.cs | 157 ++++++++++++++++++ .../Impl/Compute/Compute.cs | 79 +++++++++ .../Impl/Compute/ComputeImpl.cs | 54 ++++++ 5 files changed, 299 insertions(+) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java index ec7752a1ba817..4aaca1d90cbed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java @@ -141,6 +141,11 @@ public boolean taskSessionFullSupport() { return taskSesFullSupport; } + /** @return Task name. */ + public String taskName() { + return taskName; + } + /** * Write topology information. * diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java index ebcfc3ad5eef2..57e6005da6017 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java @@ -641,6 +641,10 @@ else if (task != null) { } } + if (task instanceof PlatformFullTask) { + taskName = ((PlatformFullTask)task).taskName(); + } + assert taskName != null; if (log.isDebugEnabled()) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs index a5d2075103428..a4c1e6d0e51a1 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs @@ -140,6 +140,19 @@ public interface ICompute /// Type of final task result. TRes Execute(IComputeTask task, TArg taskArg); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task to execute. + /// Optional task argument. + /// Task result. + /// Argument type. + /// Type of job result. + /// Type of final task result. + TRes Execute(string taskName, IComputeTask task, TArg taskArg); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -152,6 +165,19 @@ public interface ICompute /// Type of final task result. Task ExecuteAsync(IComputeTask task, TArg taskArg); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task to execute. + /// Optional task argument. + /// Task result. + /// Argument type. + /// Type of job result. + /// Type of final task result. + Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -168,6 +194,23 @@ public interface ICompute Task ExecuteAsync(IComputeTask task, TArg taskArg, CancellationToken cancellationToken); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Argument type. + /// Type of job result. + /// Type of final task result. + /// Task name + /// Task to execute. + /// Optional task argument. + /// The cancellation token. + /// + /// Task result. + /// + Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg, + CancellationToken cancellationToken); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -178,6 +221,17 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. TRes Execute(IComputeTask task); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task to execute. + /// Task result. + /// Type of job result. + /// Type of reduce result. + TRes Execute(string taskName, IComputeTask task); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -188,6 +242,17 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. Task ExecuteAsync(IComputeTask task); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task to execute. + /// Task result. + /// Type of job result. + /// Type of reduce result. + Task ExecuteAsync(string taskName, IComputeTask task); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -201,6 +266,20 @@ Task ExecuteAsync(IComputeTask t /// Task ExecuteAsync(IComputeTask task, CancellationToken cancellationToken); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Type of job result. + /// Type of reduce result. + /// Task name + /// Task to execute. + /// The cancellation token. + /// + /// Task result. + /// + Task ExecuteAsync(string taskName, IComputeTask task, CancellationToken cancellationToken); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -213,6 +292,19 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. TRes Execute(Type taskType, TArg taskArg); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task type. + /// Optional task argument. + /// Task result. + /// Argument type. + /// Type of job result. + /// Type of reduce result. + TRes Execute(string taskName, Type taskType, TArg taskArg); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -225,6 +317,19 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. Task ExecuteAsync(Type taskType, TArg taskArg); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task type. + /// Optional task argument. + /// Task result. + /// Argument type. + /// Type of job result. + /// Type of reduce result. + Task ExecuteAsync(string taskName, Type taskType, TArg taskArg); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -240,6 +345,22 @@ Task ExecuteAsync(IComputeTask t /// Task ExecuteAsync(Type taskType, TArg taskArg, CancellationToken cancellationToken); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Argument type. + /// Type of job result. + /// Type of reduce result. + /// Task name + /// Task type. + /// Optional task argument. + /// The cancellation token. + /// + /// Task result. + /// + Task ExecuteAsync(string taskName, Type taskType, TArg taskArg, CancellationToken cancellationToken); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -250,6 +371,17 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. TRes Execute(Type taskType); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task type. + /// Task result. + /// Type of job result. + /// Type of reduce result. + TRes Execute(string taskName, Type taskType); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -260,6 +392,17 @@ Task ExecuteAsync(IComputeTask t /// Type of reduce result. Task ExecuteAsync(Type taskType); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task type. + /// Task result. + /// Type of job result. + /// Type of reduce result. + Task ExecuteAsync(string taskName, Type taskType); + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -273,6 +416,20 @@ Task ExecuteAsync(IComputeTask t /// Task ExecuteAsync(Type taskType, CancellationToken cancellationToken); + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Type of job result. + /// Type of reduce result. + /// Task name + /// Task type. + /// The cancellation token. + /// + /// Task result. + /// + Task ExecuteAsync(string taskName, Type taskType, CancellationToken cancellationToken); + /// /// Executes provided job on a node in this grid projection. The result of the /// job execution is returned from the result closure. diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs index 0b7627c32ac96..8412fb286ded8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs @@ -117,12 +117,24 @@ public TReduceRes Execute(IComputeTask */ + public TReduceRes Execute(string taskName, IComputeTask task, TArg taskArg) + { + return _compute.Execute(taskName, task, taskArg).Get(); + } + /** */ public Task ExecuteAsync(IComputeTask task, TArg taskArg) { return _compute.Execute(task, taskArg).Task; } + /** */ + public Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg) + { + return _compute.Execute(taskName, task, taskArg).Task; + } + /** */ public Task ExecuteAsync(IComputeTask task, TArg taskArg, CancellationToken cancellationToken) @@ -131,18 +143,38 @@ public Task ExecuteAsync(IComputeTask */ + public Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg, + CancellationToken cancellationToken) + { + return GetTaskIfAlreadyCancelled(cancellationToken) ?? + _compute.Execute(taskName, task, taskArg).GetTask(cancellationToken); + } + /** */ public TJobRes Execute(IComputeTask task) { return _compute.Execute(task, null).Get(); } + /** */ + public TJobRes Execute(string taskName, IComputeTask task) + { + return _compute.Execute(taskName, task, null).Get(); + } + /** */ public Task ExecuteAsync(IComputeTask task) { return _compute.Execute(task, null).Task; } + /** */ + public Task ExecuteAsync(string taskName, IComputeTask task) + { + return _compute.Execute(taskName, task, null).Task; + } + /** */ public Task ExecuteAsync(IComputeTask task, CancellationToken cancellationToken) @@ -151,18 +183,38 @@ public Task ExecuteAsync(IComputeTask task, _compute.Execute(task, null).GetTask(cancellationToken); } + /** */ + public Task ExecuteAsync(string taskName, IComputeTask task, + CancellationToken cancellationToken) + { + return GetTaskIfAlreadyCancelled(cancellationToken) ?? + _compute.Execute(taskName, task, null).GetTask(cancellationToken); + } + /** */ public TReduceRes Execute(Type taskType, TArg taskArg) { return _compute.Execute(taskType, taskArg).Get(); } + /** */ + public TReduceRes Execute(string taskName, Type taskType, TArg taskArg) + { + return _compute.Execute(taskName, taskType, taskArg).Get(); + } + /** */ public Task ExecuteAsync(Type taskType, TArg taskArg) { return _compute.Execute(taskType, taskArg).Task; } + /** */ + public Task ExecuteAsync(string taskName, Type taskType, TArg taskArg) + { + return _compute.Execute(taskName, taskType, taskArg).Task; + } + /** */ public Task ExecuteAsync(Type taskType, TArg taskArg, CancellationToken cancellationToken) @@ -171,18 +223,38 @@ public Task ExecuteAsync(Type taskType, T _compute.Execute(taskType, taskArg).GetTask(cancellationToken); } + /** */ + public Task ExecuteAsync(string taskName, Type taskType, TArg taskArg, + CancellationToken cancellationToken) + { + return GetTaskIfAlreadyCancelled(cancellationToken) ?? + _compute.Execute(taskName, taskType, taskArg).GetTask(cancellationToken); + } + /** */ public TReduceRes Execute(Type taskType) { return _compute.Execute(taskType, null).Get(); } + /** */ + public TReduceRes Execute(string taskName, Type taskType) + { + return _compute.Execute(taskName, taskType, null).Get(); + } + /** */ public Task ExecuteAsync(Type taskType) { return _compute.Execute(taskType, null).Task; } + /** */ + public Task ExecuteAsync(string taskName, Type taskType) + { + return _compute.Execute(taskName, taskType, null).Task; + } + /** */ public Task ExecuteAsync(Type taskType, CancellationToken cancellationToken) { @@ -190,6 +262,13 @@ public Task ExecuteAsync(Type taskType, Cancellati _compute.Execute(taskType, null).GetTask(cancellationToken); } + /** */ + public Task ExecuteAsync(string taskName, Type taskType, CancellationToken cancellationToken) + { + return GetTaskIfAlreadyCancelled(cancellationToken) ?? + _compute.Execute(taskName, taskType, null).GetTask(cancellationToken); + } + /** */ public TJobRes Call(IComputeFunc clo) { diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs index 8e9a6a1dd13ec..3d48693fbe17a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs @@ -247,6 +247,38 @@ public Future Execute(IComputeTask + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name + /// Task to execute. + /// Optional task argument. + /// Task result. + public Future Execute(string taskName, IComputeTask task, TArg taskArg) + { + IgniteArgumentCheck.NotNull(task, "task"); + + var holder = new ComputeTaskHolder((Ignite) _prj.Ignite, this, task, taskArg); + + long ptr = Marshaller.Ignite.HandleRegistry.Allocate(holder); + + var futTarget = DoOutOpObject(OpExecNative, s => + { + s.WriteLong(ptr); + s.WriteLong(_prj.TopologyVersion); + s.WriteString(taskName); + s.WriteBoolean(holder.TaskSessionFullSupport); + }); + + var future = holder.Future; + + future.SetTarget(new Listenable(futTarget)); + + return future; + } + /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -268,6 +300,28 @@ public Future Execute(Type taskType, TArg return Execute(task0, taskArg); } + /// + /// Executes given task on the grid projection. For step-by-step explanation of task execution process + /// refer to documentation. + /// + /// Task name. + /// Task type. + /// Optional task argument. + /// Task result. + public Future Execute(string taskName, Type taskType, TArg taskArg) + { + IgniteArgumentCheck.NotNull(taskType, "taskType"); + + object task = FormatterServices.GetUninitializedObject(taskType); + + var task0 = task as IComputeTask; + + if (task0 == null) + throw new IgniteException("Task type doesn't implement IComputeTask: " + taskType.Name); + + return Execute(taskName, task0, taskArg); + } + /// /// Executes provided job on a node in this grid projection. The result of the /// job execution is returned from the result closure. From 76d74cfb0f683b060c7893afce95f409520825ac Mon Sep 17 00:00:00 2001 From: Ravil Zakirov Date: Mon, 29 Dec 2025 21:43:40 +0300 Subject: [PATCH 2/3] IGNITE-27341 Rolled back changes in .Net compute task API. --- .../Apache.Ignite.Core/Compute/ICompute.cs | 157 ------------------ .../Impl/Compute/Compute.cs | 79 --------- .../Impl/Compute/ComputeImpl.cs | 54 ------ 3 files changed, 290 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs index a4c1e6d0e51a1..a5d2075103428 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs @@ -140,19 +140,6 @@ public interface ICompute /// Type of final task result. TRes Execute(IComputeTask task, TArg taskArg); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task to execute. - /// Optional task argument. - /// Task result. - /// Argument type. - /// Type of job result. - /// Type of final task result. - TRes Execute(string taskName, IComputeTask task, TArg taskArg); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -165,19 +152,6 @@ public interface ICompute /// Type of final task result. Task ExecuteAsync(IComputeTask task, TArg taskArg); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task to execute. - /// Optional task argument. - /// Task result. - /// Argument type. - /// Type of job result. - /// Type of final task result. - Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -194,23 +168,6 @@ public interface ICompute Task ExecuteAsync(IComputeTask task, TArg taskArg, CancellationToken cancellationToken); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Argument type. - /// Type of job result. - /// Type of final task result. - /// Task name - /// Task to execute. - /// Optional task argument. - /// The cancellation token. - /// - /// Task result. - /// - Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg, - CancellationToken cancellationToken); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -221,17 +178,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. TRes Execute(IComputeTask task); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task to execute. - /// Task result. - /// Type of job result. - /// Type of reduce result. - TRes Execute(string taskName, IComputeTask task); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -242,17 +188,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. Task ExecuteAsync(IComputeTask task); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task to execute. - /// Task result. - /// Type of job result. - /// Type of reduce result. - Task ExecuteAsync(string taskName, IComputeTask task); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -266,20 +201,6 @@ Task ExecuteAsync(string taskName, IComputeTask Task ExecuteAsync(IComputeTask task, CancellationToken cancellationToken); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Type of job result. - /// Type of reduce result. - /// Task name - /// Task to execute. - /// The cancellation token. - /// - /// Task result. - /// - Task ExecuteAsync(string taskName, IComputeTask task, CancellationToken cancellationToken); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -292,19 +213,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. TRes Execute(Type taskType, TArg taskArg); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task type. - /// Optional task argument. - /// Task result. - /// Argument type. - /// Type of job result. - /// Type of reduce result. - TRes Execute(string taskName, Type taskType, TArg taskArg); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -317,19 +225,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. Task ExecuteAsync(Type taskType, TArg taskArg); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task type. - /// Optional task argument. - /// Task result. - /// Argument type. - /// Type of job result. - /// Type of reduce result. - Task ExecuteAsync(string taskName, Type taskType, TArg taskArg); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -345,22 +240,6 @@ Task ExecuteAsync(string taskName, IComputeTask Task ExecuteAsync(Type taskType, TArg taskArg, CancellationToken cancellationToken); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Argument type. - /// Type of job result. - /// Type of reduce result. - /// Task name - /// Task type. - /// Optional task argument. - /// The cancellation token. - /// - /// Task result. - /// - Task ExecuteAsync(string taskName, Type taskType, TArg taskArg, CancellationToken cancellationToken); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -371,17 +250,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. TRes Execute(Type taskType); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task type. - /// Task result. - /// Type of job result. - /// Type of reduce result. - TRes Execute(string taskName, Type taskType); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -392,17 +260,6 @@ Task ExecuteAsync(string taskName, IComputeTaskType of reduce result. Task ExecuteAsync(Type taskType); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task type. - /// Task result. - /// Type of job result. - /// Type of reduce result. - Task ExecuteAsync(string taskName, Type taskType); - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -416,20 +273,6 @@ Task ExecuteAsync(string taskName, IComputeTask Task ExecuteAsync(Type taskType, CancellationToken cancellationToken); - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Type of job result. - /// Type of reduce result. - /// Task name - /// Task type. - /// The cancellation token. - /// - /// Task result. - /// - Task ExecuteAsync(string taskName, Type taskType, CancellationToken cancellationToken); - /// /// Executes provided job on a node in this grid projection. The result of the /// job execution is returned from the result closure. diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs index 8412fb286ded8..0b7627c32ac96 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs @@ -117,24 +117,12 @@ public TReduceRes Execute(IComputeTask */ - public TReduceRes Execute(string taskName, IComputeTask task, TArg taskArg) - { - return _compute.Execute(taskName, task, taskArg).Get(); - } - /** */ public Task ExecuteAsync(IComputeTask task, TArg taskArg) { return _compute.Execute(task, taskArg).Task; } - /** */ - public Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg) - { - return _compute.Execute(taskName, task, taskArg).Task; - } - /** */ public Task ExecuteAsync(IComputeTask task, TArg taskArg, CancellationToken cancellationToken) @@ -143,38 +131,18 @@ public Task ExecuteAsync(IComputeTask */ - public Task ExecuteAsync(string taskName, IComputeTask task, TArg taskArg, - CancellationToken cancellationToken) - { - return GetTaskIfAlreadyCancelled(cancellationToken) ?? - _compute.Execute(taskName, task, taskArg).GetTask(cancellationToken); - } - /** */ public TJobRes Execute(IComputeTask task) { return _compute.Execute(task, null).Get(); } - /** */ - public TJobRes Execute(string taskName, IComputeTask task) - { - return _compute.Execute(taskName, task, null).Get(); - } - /** */ public Task ExecuteAsync(IComputeTask task) { return _compute.Execute(task, null).Task; } - /** */ - public Task ExecuteAsync(string taskName, IComputeTask task) - { - return _compute.Execute(taskName, task, null).Task; - } - /** */ public Task ExecuteAsync(IComputeTask task, CancellationToken cancellationToken) @@ -183,38 +151,18 @@ public Task ExecuteAsync(IComputeTask task, _compute.Execute(task, null).GetTask(cancellationToken); } - /** */ - public Task ExecuteAsync(string taskName, IComputeTask task, - CancellationToken cancellationToken) - { - return GetTaskIfAlreadyCancelled(cancellationToken) ?? - _compute.Execute(taskName, task, null).GetTask(cancellationToken); - } - /** */ public TReduceRes Execute(Type taskType, TArg taskArg) { return _compute.Execute(taskType, taskArg).Get(); } - /** */ - public TReduceRes Execute(string taskName, Type taskType, TArg taskArg) - { - return _compute.Execute(taskName, taskType, taskArg).Get(); - } - /** */ public Task ExecuteAsync(Type taskType, TArg taskArg) { return _compute.Execute(taskType, taskArg).Task; } - /** */ - public Task ExecuteAsync(string taskName, Type taskType, TArg taskArg) - { - return _compute.Execute(taskName, taskType, taskArg).Task; - } - /** */ public Task ExecuteAsync(Type taskType, TArg taskArg, CancellationToken cancellationToken) @@ -223,38 +171,18 @@ public Task ExecuteAsync(Type taskType, T _compute.Execute(taskType, taskArg).GetTask(cancellationToken); } - /** */ - public Task ExecuteAsync(string taskName, Type taskType, TArg taskArg, - CancellationToken cancellationToken) - { - return GetTaskIfAlreadyCancelled(cancellationToken) ?? - _compute.Execute(taskName, taskType, taskArg).GetTask(cancellationToken); - } - /** */ public TReduceRes Execute(Type taskType) { return _compute.Execute(taskType, null).Get(); } - /** */ - public TReduceRes Execute(string taskName, Type taskType) - { - return _compute.Execute(taskName, taskType, null).Get(); - } - /** */ public Task ExecuteAsync(Type taskType) { return _compute.Execute(taskType, null).Task; } - /** */ - public Task ExecuteAsync(string taskName, Type taskType) - { - return _compute.Execute(taskName, taskType, null).Task; - } - /** */ public Task ExecuteAsync(Type taskType, CancellationToken cancellationToken) { @@ -262,13 +190,6 @@ public Task ExecuteAsync(Type taskType, Cancellati _compute.Execute(taskType, null).GetTask(cancellationToken); } - /** */ - public Task ExecuteAsync(string taskName, Type taskType, CancellationToken cancellationToken) - { - return GetTaskIfAlreadyCancelled(cancellationToken) ?? - _compute.Execute(taskName, taskType, null).GetTask(cancellationToken); - } - /** */ public TJobRes Call(IComputeFunc clo) { diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs index 3d48693fbe17a..8e9a6a1dd13ec 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs @@ -247,38 +247,6 @@ public Future Execute(IComputeTask - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name - /// Task to execute. - /// Optional task argument. - /// Task result. - public Future Execute(string taskName, IComputeTask task, TArg taskArg) - { - IgniteArgumentCheck.NotNull(task, "task"); - - var holder = new ComputeTaskHolder((Ignite) _prj.Ignite, this, task, taskArg); - - long ptr = Marshaller.Ignite.HandleRegistry.Allocate(holder); - - var futTarget = DoOutOpObject(OpExecNative, s => - { - s.WriteLong(ptr); - s.WriteLong(_prj.TopologyVersion); - s.WriteString(taskName); - s.WriteBoolean(holder.TaskSessionFullSupport); - }); - - var future = holder.Future; - - future.SetTarget(new Listenable(futTarget)); - - return future; - } - /// /// Executes given task on the grid projection. For step-by-step explanation of task execution process /// refer to documentation. @@ -300,28 +268,6 @@ public Future Execute(Type taskType, TArg return Execute(task0, taskArg); } - /// - /// Executes given task on the grid projection. For step-by-step explanation of task execution process - /// refer to documentation. - /// - /// Task name. - /// Task type. - /// Optional task argument. - /// Task result. - public Future Execute(string taskName, Type taskType, TArg taskArg) - { - IgniteArgumentCheck.NotNull(taskType, "taskType"); - - object task = FormatterServices.GetUninitializedObject(taskType); - - var task0 = task as IComputeTask; - - if (task0 == null) - throw new IgniteException("Task type doesn't implement IComputeTask: " + taskType.Name); - - return Execute(taskName, task0, taskArg); - } - /// /// Executes provided job on a node in this grid projection. The result of the /// job execution is returned from the result closure. From aefc7df3472caa6fad363ea887cdb2afc119b696 Mon Sep 17 00:00:00 2001 From: Ravil Zakirov Date: Tue, 30 Dec 2025 12:52:02 +0300 Subject: [PATCH 3/3] IGNITE-27341 Fixed checkstyle --- .../ignite/internal/processors/task/GridTaskProcessor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java index 57e6005da6017..3c8d15c7f4687 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java @@ -641,9 +641,8 @@ else if (task != null) { } } - if (task instanceof PlatformFullTask) { + if (task instanceof PlatformFullTask) taskName = ((PlatformFullTask)task).taskName(); - } assert taskName != null;