aol
aol

Reputation: 377

Apache Ignite - difference of affinityRun vs affinityCall

What is the difference between the affinityCall and affinityRun methods?

The doc doesn't say: https://apacheignite.readme.io/docs/affinity-collocation

And the javadoc is nearly identical:

/**
 * Executes given job on the node where partition is located (the partition is primary on the node)
 * </p>
 * It's guaranteed that the data of all the partitions of all participating caches,
 * the affinity key belongs to, will present on the destination node throughout the job execution.
 *
 * @param cacheNames Names of the caches to to reserve the partition. The first cache uses for affinity co-location.
 * @param partId Partition to reserve.
 * @param job Job which will be co-located on the node with given affinity key.
 * @return Job result.
 * @throws IgniteException If job failed.
 */

vs.

/**
 * Executes given job on the node where partition is located (the partition is primary on the node)
 * </p>
 * It's guaranteed that the data of all the partitions of all participating caches,
 * the affinity key belongs to, will present on the destination node throughout the job execution.
 *
 * @param cacheNames Names of the caches to to reserve the partition. The first cache is used for
 *                   affinity co-location.
 * @param partId Partition number.
 * @param job Job which will be co-located on the node with given affinity key.
 * @throws IgniteException If job failed.
 */

Thank you

Upvotes: 1

Views: 293

Answers (1)

Denis Mekhanikov
Denis Mekhanikov

Reputation: 3591

The difference is that IgniteCompute#affinityCall() may return some result of computation, but IgniteCompute#affinityRun() always returns void.

Upvotes: 2

Related Questions