Apache Ignite-affinityRun与affinityCall的区别
Apache Ignite-affinityRun与affinityCall的区别,ignite,Ignite,affinityCall和affinityRun方法之间有什么区别 医生没有说: 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
affinityCall
和affinityRun
方法之间有什么区别
医生没有说:
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.
*/
/**
*在分区所在的节点上执行给定的作业(该分区是节点上的主分区)
*
*保证所有参与缓存的所有分区的数据,
*在整个作业执行过程中,关联密钥所属的将出现在目标节点上。
*
*@param cachename要保留分区的缓存的名称。第一个缓存用于关联共定位。
*@param partId分区要保留。
*@param作业作业将与给定的关联密钥共同位于节点上。
*@返回作业结果。
*@如果作业失败,则引发异常。
*/
vs
/**
*在分区所在的节点上执行给定的作业(该分区是节点上的主分区)
*
*保证所有参与缓存的所有分区的数据,
*在整个作业执行过程中,关联密钥所属的将出现在目标节点上。
*
*@param cachename要保留分区的缓存的名称。第一个缓存用于
*亲和共定位。
*@param partId分区号。
*@param作业作业将与给定的关联密钥共同位于节点上。
*@如果作业失败,则引发异常。
*/
谢谢区别在于
IgniteCompute#affinityCall()
可能会返回一些计算结果,但IgniteCompute#affinityRun()
总是返回void
/**
* 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.
*/