[ 
https://issues.apache.org/jira/browse/IGNITE-2310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Denis Magda updated IGNITE-2310:
--------------------------------
    Description: 
Partition of a key passed to {{affinityRun}} must be located on the affinity 
node when a compute job is being sent to the node. The partition has to be 
locked on the cache until the compute job is being executed. This will let to 
execute queries safely (Scan or local SQL) over the data that is located 
locally in the locked partition.

In addition Ignite Compute API has to be extended by adding {{affinityCall}} 
and {{affinityRun}} methods that accept list of caches which partitions have to 
be locked at the time a compute task is being executed.

Test cases to validate the functionality:

1) local SQL query over data located in a concrete partition in multple caches.
- create cache Organisation cache and create Persons cache.
- collocate Persons by 'organisationID';
- send {{affinityRun}} using 'organisationID' as an affinity key and passing 
Organisation and Persons caches' names to the method to be sure that the 
partition will be locked on caches;
- execute local SQL query "SELECT * FROM Persons as p, Organisation as o WHERE 
p.orgId=o.id' on a changing topology. The result set must be complete, the 
partition over which the query will be executed mustn't be moved to the other 
node. Due to affinity collocation the partition number will be the same for all 
Persons that belong to particular 'organisationID'

2) Scan Query over particular partition that is locked when {{affinityCall}} is 
executed.  

  was:
For jobs executed using affinityRun/affinityCall methods need to make sure that 
node executing job owns required cache partition and partition is not moved 
while job runs.

Also need to add methods with list of caches: affinityRun(Collection<String> 
cacheNames, Object affKey, IgniteRunnable job), affinityCall(Collection<String> 
cacheNames, Object affKey, IgniteCallable<R> job), for this methods need to 
make sure that parition in all caches is available while job runs.

Note: similar logic waiting/blocking partitions in already implemented for sql 
queries.


> Lock cache partition for affinityRun/affinityCall execution
> -----------------------------------------------------------
>
>                 Key: IGNITE-2310
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2310
>             Project: Ignite
>          Issue Type: New Feature
>          Components: cache
>            Reporter: Valentin Kulichenko
>            Assignee: Andrey Gura
>            Priority: Critical
>              Labels: community
>             Fix For: 1.6
>
>
> Partition of a key passed to {{affinityRun}} must be located on the affinity 
> node when a compute job is being sent to the node. The partition has to be 
> locked on the cache until the compute job is being executed. This will let to 
> execute queries safely (Scan or local SQL) over the data that is located 
> locally in the locked partition.
> In addition Ignite Compute API has to be extended by adding {{affinityCall}} 
> and {{affinityRun}} methods that accept list of caches which partitions have 
> to be locked at the time a compute task is being executed.
> Test cases to validate the functionality:
> 1) local SQL query over data located in a concrete partition in multple 
> caches.
> - create cache Organisation cache and create Persons cache.
> - collocate Persons by 'organisationID';
> - send {{affinityRun}} using 'organisationID' as an affinity key and passing 
> Organisation and Persons caches' names to the method to be sure that the 
> partition will be locked on caches;
> - execute local SQL query "SELECT * FROM Persons as p, Organisation as o 
> WHERE p.orgId=o.id' on a changing topology. The result set must be complete, 
> the partition over which the query will be executed mustn't be moved to the 
> other node. Due to affinity collocation the partition number will be the same 
> for all Persons that belong to particular 'organisationID'
> 2) Scan Query over particular partition that is locked when {{affinityCall}} 
> is executed.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to