affinityCall
和affinityRun
方法之间有什么区别?
文档没有说: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.
*/
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.
*/
谢谢
答案 0 :(得分:2)
区别在于IgniteCompute#affinityCall()
可能会返回一些计算结果,但IgniteCompute#affinityRun()
总是返回void。