Skip to content

Commit

Permalink
style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dorx committed Jul 8, 2014
1 parent bbfb8c9 commit 9884a9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])

val samplingFunc = if (withReplacement) {
val counts = if (exact) Some(this.countByKey()) else None
StratifiedSampler.getPoissonSamplingFunction(self, fractions, exact, counts, seed)
StratifiedSampler.getPoissonSamplingFunction(self, fractions, exact, counts, seed)
} else {
StratifiedSampler.getBernoulliSamplingFunction(self, fractions, exact, seed)
StratifiedSampler.getBernoulliSamplingFunction(self, fractions, exact, seed)
}
self.mapPartitionsWithIndex(samplingFunc, preservesPartitioning=true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ private[spark] object StratifiedSampler extends Logging {
* to be included in the sample.
*/
def computeThresholdByKey[K](finalResult: Map[K, Stratum],
fractions: Map[K, Double]):
Map[K, Double] = {
fractions: Map[K, Double]): Map[K, Double] = {
val thresholdByKey = new HashMap[K, Double]()
for ((key, stratum) <- finalResult) {
val s = math.ceil(stratum.numItems * fractions(key)).toLong
Expand Down

0 comments on commit 9884a9f

Please sign in to comment.