Skip to content

Commit

Permalink
Create a local ref to model object to avoid sending the entire object…
Browse files Browse the repository at this point in the history
… over the wire.
  • Loading branch information
Sameer Abhyankar authored and Sameer Abhyankar committed Aug 18, 2015
1 parent 6bf0bec commit 98fa159
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class IDFModel private[spark] (val idf: Vector) extends Serializable {
case None => bcIdf = Some(dataset.context.broadcast(idf))
case _ =>
}
dataset.mapPartitions(iter => iter.map(v => IDFModel.transform(bcIdf.get.value, v)))
val lclBcIdf = bcIdf
dataset.mapPartitions(iter => iter.map(v => IDFModel.transform(lclBcIdf.get.value, v)))
}

/**
Expand Down

0 comments on commit 98fa159

Please sign in to comment.