Please take a look at the following method:
/**
* Get the preferred locations of a partition, taking into account
whether the
* RDD is checkpointed.
*/
final def preferredLocations(split: Partition): Seq[String] = {
checkpointRDD.map(_.getPreferredLocations(split)).getOrElse {
getPreferredLocations(split)
}
}
On Sat, Mar 26, 2016 at 7:41 AM, chenyong <[email protected]> wrote:
> I am newbie to the greate spark framework. After reading some meterials
> about spark, I know that a RDD dataset are actually broken into pieces and
> distributed among serveral nodes. I am wondering whether a certain piece
> can be assigned to a specicified node by some codes in my program. Or
> pieces are randomly assigned to nodes.
>
> Thanks in advance
>
> Felix Chen
>