From 2c88827679c6ef1ff10d7ec6b161aaa831043de2 Mon Sep 17 00:00:00 2001 From: "P. Oscar Boykin" Date: Tue, 3 Feb 2015 15:35:12 -1000 Subject: [PATCH] Back out 4 changes to be binary compatible! --- .../src/main/scala/com/twitter/scalding/RichPipe.scala | 2 +- .../main/scala/com/twitter/scalding/mathematics/Poisson.scala | 2 +- .../com/twitter/scalding/mathematics/TypedSimilarity.scala | 4 ++-- .../src/main/scala/com/twitter/scalding/typed/Sketched.scala | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scalding-core/src/main/scala/com/twitter/scalding/RichPipe.scala b/scalding-core/src/main/scala/com/twitter/scalding/RichPipe.scala index 86e42ede58..a867cad1e2 100644 --- a/scalding-core/src/main/scala/com/twitter/scalding/RichPipe.scala +++ b/scalding-core/src/main/scala/com/twitter/scalding/RichPipe.scala @@ -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 diff --git a/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Poisson.scala b/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Poisson.scala index 1fb833a08d..e9112f983f 100644 --- a/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Poisson.scala +++ b/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Poisson.scala @@ -1,6 +1,6 @@ package com.twitter.scalding.mathematics -import java.util.Random +import scala.util.Random /** * Generating Poisson-distributed random variables diff --git a/scalding-core/src/main/scala/com/twitter/scalding/mathematics/TypedSimilarity.scala b/scalding-core/src/main/scala/com/twitter/scalding/mathematics/TypedSimilarity.scala index 16ad6de377..3377ede124 100644 --- a/scalding-core/src/main/scala/com/twitter/scalding/mathematics/TypedSimilarity.scala +++ b/scalding-core/src/main/scala/com/twitter/scalding/mathematics/TypedSimilarity.scala @@ -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 { @@ -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 { diff --git a/scalding-core/src/main/scala/com/twitter/scalding/typed/Sketched.scala b/scalding-core/src/main/scala/com/twitter/scalding/typed/Sketched.scala index 93497c0ede..47783a71b6 100644 --- a/scalding-core/src/main/scala/com/twitter/scalding/typed/Sketched.scala +++ b/scalding-core/src/main/scala/com/twitter/scalding/typed/Sketched.scala @@ -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) }