[
https://issues.apache.org/jira/browse/IGNITE-5037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16223960#comment-16223960
]
Alexei Scherbakov commented on IGNITE-5037:
-------------------------------------------
[~ihorpts],
Actually, there is a way to do affinity collocated computations using current
API.
You should use IgniteCompute.affinityRunAsync/affinityCallAsync methods which
take partId as argument.
Collect futures and wait for all of them to complete.
Each closure is guaranteed to run locally with data for given partition, and
will hold the partition data from evictions(on rebalancing) until computation
is not finished.
If node left while running closure, it wil be restarted on new primary node for
partition.
I recommend to ask on user list if you still have questions.
> Fix broken @AffinityKeyMapped annotation for compute jobs.
> ----------------------------------------------------------
>
> Key: IGNITE-5037
> URL: https://issues.apache.org/jira/browse/IGNITE-5037
> Project: Ignite
> Issue Type: Improvement
> Affects Versions: 1.7
> Reporter: Alexei Scherbakov
> Assignee: Maksim Kozlov
> Labels: newbie
>
> See related discussion on dev list entitled Proper collocation of
> computations and data
> (http://apache-ignite-developers.2346864.n4.nabble.com/Proper-collocation-of-computations-and-data-td16945.html).
> We must repair data affinity routing for compute jobs. It should work same as
> for affinityCall/Run with partition.
> Currently, ComputeTask map method returns Map<? extends ComputeJob,
> ClusterNode>,
> but we have to provide some API allows to map ComputeJobs to partitions or
> keys.
> This can be done using AffinityKeyMapped annotation or any other way.
> Since that's a publiŃ API any fixes should be discussed on dev list prior to
> implementation.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)