Github user tmyklebu commented on a diff in the pull request:
https://github.com/apache/spark/pull/593#discussion_r12214297
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/recommendation/ALS.scala ---
@@ -381,14 +399,15 @@ class ALS private (
* the users (or (blockId, (p, u, r)) for the products). We create these
simultaneously to avoid
* having to shuffle the (blockId, (u, p, r)) RDD twice, or to cache it.
*/
- private def makeLinkRDDs(numBlocks: Int, ratings: RDD[(Int, Rating)],
partitioner: Partitioner)
+ private def makeLinkRDDs(numUserBlocks: Int, numProductBlocks: Int,
ratings: RDD[(Int, Rating)],
+ userPartitioner: Partitioner, productPartitioner: Partitioner)
: (RDD[(Int, InLinkBlock)], RDD[(Int, OutLinkBlock)]) =
{
- val grouped = ratings.partitionBy(new HashPartitioner(numBlocks))
+ val grouped = ratings.partitionBy(new HashPartitioner(numUserBlocks))
--- End diff --
Not sure I understand. That `HashPartitioner` serves as the identity map
on the `blockId`s. The `blockId` in the `mapPartitionsWithValues` on the next
line coincides with the `blockId`s of all of the ratings in `elements`.
`makeLinkRDDs` returns two RDDs that are both partitioned by that
`HashPartitioner`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---