Skip to content

Commit

Permalink
Merge pull request #1187 from twitter/lessrandom
Browse files Browse the repository at this point in the history
Back out 4 changes to be binary compatible
  • Loading branch information
isnotinvain committed Feb 4, 2015
2 parents e1bce52 + 2c88827 commit 2d0417c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import cascading.tuple._
import cascading.cascade._
import cascading.operation.Debug.Output

import java.util.Random
import scala.util.Random

import java.util.concurrent.atomic.AtomicInteger

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.twitter.scalding.mathematics

import java.util.Random
import scala.util.Random

/**
* Generating Poisson-distributed random variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ object TypedSimilarity extends Serializable {
bigG: Grouped[N, (N, Int)], oversample: Double): TypedPipe[Edge[N, Double]] = {
// 1) make rnd lazy due to serialization,
// 2) fix seed so that map-reduce speculative execution does not give inconsistent results.
lazy val rnd = new java.util.Random(1024)
lazy val rnd = new scala.util.Random(1024)
maybeWithReducers(smallG.cogroup(bigG) { (n: N, leftit: Iterator[(N, Int)], rightit: Iterable[(N, Int)]) =>
// Use a co-group to ensure this happens in the reducer:
leftit.flatMap {
Expand Down Expand Up @@ -185,7 +185,7 @@ object TypedSimilarity extends Serializable {
*/
def dimsumCosineSimilarity[N: Ordering](smallG: Grouped[N, (N, Double, Double)],
bigG: Grouped[N, (N, Double, Double)], oversample: Double): TypedPipe[Edge[N, Double]] = {
lazy val rnd = new java.util.Random(1024)
lazy val rnd = new scala.util.Random(1024)
maybeWithReducers(smallG.cogroup(bigG) { (n: N, leftit: Iterator[(N, Double, Double)], rightit: Iterable[(N, Double, Double)]) =>
// Use a co-group to ensure this happens in the reducer:
leftit.flatMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ case class SketchJoined[K: Ordering, V, V2, R](left: Sketched[K, V],
}

lazy val toTypedPipe: TypedPipe[(K, R)] = {
lazy val rand = new java.util.Random(left.seed)
lazy val rand = new scala.util.Random(left.seed)
val lhs = flatMapWithReplicas(left.pipe){ n => Some(rand.nextInt(n) + 1) }
val rhs = flatMapWithReplicas(right){ n => 1.to(n) }

Expand Down

0 comments on commit 2d0417c

Please sign in to comment.