Apache Ignite - affinityRun与affinityCall的区别

问题描述 投票:1回答:1

affinityCallaffinityRun方法有什么区别?

该文件没有说:https://apacheignite.readme.io/docs/affinity-collocation

而javadoc几乎完全相同:

/**
 * 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.
 */

/**
 * 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.
 */

谢谢

ignite
1个回答
2
投票

区别在于IgniteCompute#affinityCall()可能返回一些计算结果,但IgniteCompute#affinityRun()总是返回void。

© www.soinside.com 2019 - 2024. All rights reserved.