This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-27278
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/ignite-27278 by this push:
new 29f6c12be9f wip
29f6c12be9f is described below
commit 29f6c12be9f75083d2a047637862eabf1344dbfa
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Tue Dec 23 09:49:16 2025 +0200
wip
---
.../Apache.Ignite/Internal/Compute/Compute.cs | 29 ++++++++++++++++------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite/Internal/Compute/Compute.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Compute/Compute.cs
index 8fa0a23aab7..3f195699b5e 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/Compute/Compute.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/Compute/Compute.cs
@@ -79,7 +79,9 @@ namespace Apache.Ignite.Internal.Compute
{
JobTarget.SingleNodeTarget singleNode =>
SubmitAsync([singleNode.Data], jobDescriptor, arg, cancellationToken),
JobTarget.AnyNodeTarget anyNode => SubmitAsync(anyNode.Data,
jobDescriptor, arg, cancellationToken),
- JobTarget.ColocatedTarget<TTarget> colocated =>
SubmitColocatedAsync(colocated, jobDescriptor, arg, cancellationToken),
+
+ // TODO: Should mapper come from target?
+ JobTarget.ColocatedTarget<TTarget> colocated =>
SubmitColocatedAsync(colocated, jobDescriptor, arg, null, cancellationToken),
_ => throw new ArgumentException("Unsupported job target: " +
target)
};
@@ -608,6 +610,7 @@ namespace Apache.Ignite.Internal.Compute
JobTarget.ColocatedTarget<TKey> target,
JobDescriptor<TArg, TResult> jobDescriptor,
TArg arg,
+ IMapper<TKey>? mapper,
CancellationToken cancellationToken)
where TKey : notnull
{
@@ -625,10 +628,25 @@ namespace Apache.Ignite.Internal.Compute
.ConfigureAwait(false);
}
+ if (mapper != null)
+ {
+ // TODO: Avoid allocation.
+ Func<Table, IRecordSerializerHandler<TKey>> handlerFunc = _ =>
new MapperSerializerHandler<TKey>(mapper);
+
+ return await ExecuteColocatedAsync<TArg, TResult, TKey>(
+ target.TableName,
+ target.Data,
+ handlerFunc,
+ jobDescriptor,
+ arg,
+ cancellationToken)
+ .ConfigureAwait(false);
+ }
+
return await ExecuteColocatedAsync<TArg, TResult, TKey>(
target.TableName,
target.Data,
- static table => GetSerializerHandler(table, null),
+ static table => GetSerializerHandler(table),
jobDescriptor,
arg,
cancellationToken)
@@ -636,13 +654,8 @@ namespace Apache.Ignite.Internal.Compute
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification
= "IGNITE-27278")]
[UnconditionalSuppressMessage("Trimming", "IL3050", Justification
= "IGNITE-27278")]
- static IRecordSerializerHandler<TKey> GetSerializerHandler(Table
table, IMapper<TKey>? mapper)
+ static IRecordSerializerHandler<TKey> GetSerializerHandler(Table
table)
{
- if (mapper != null)
- {
- return new MapperSerializerHandler<TKey>(mapper);
- }
-
if (!RuntimeFeature.IsDynamicCodeSupported)
{
// TODO IGNITE-27278: Remove suppression and require
mapper in trimmed mode.