Skip to content

Commit 07bb06e

Browse files
committed
SPARK-1438 fixing more space formatting issues
1 parent b9ebfe2 commit 07bb06e

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

core/src/main/scala/org/apache/spark/rdd/PartitionwiseSampledRDD.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class PartitionwiseSampledRDDPartition(val prev: Partition, val seed: Long)
3939
*
4040
* @param prev RDD to be sampled
4141
* @param sampler a random sampler
42-
* @param seed random seed, default to a Long value generated by an instance of
43-
* java.util.Random shared within the library code
42+
* @param seed random seed
4443
* @tparam T input RDD item type
4544
* @tparam U sampled RDD item type
4645
*/

core/src/main/scala/org/apache/spark/rdd/RDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ abstract class RDD[T: ClassTag](
336336
* Randomly splits this RDD with the provided weights.
337337
*
338338
* @param weights weights for splits, will be normalized if they don't sum to 1
339-
* @param seed random seed, default to rand.nextLong
339+
* @param seed random seed
340340
*
341341
* @return split RDDs in an array
342342
*/

core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ class RDDSuite extends FunSuite with SharedSparkContext {
466466
test("takeSample") {
467467
val data = sc.parallelize(1 to 100, 2)
468468

469-
for (num <- List(5,20,100)) {
469+
for (num <- List(5, 20, 100)) {
470470
val sample = data.takeSample(withReplacement=false, num=num)
471471
assert(sample.size === num) // Got exactly num elements
472472
assert(sample.toSet.size === num) // Elements are distinct

python/pyspark/rdd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ def takeSample(self, withReplacement, num, seed=None):
384384
# See: scala/spark/RDD.scala
385385
rand = Random(seed)
386386
while len(samples) < total:
387-
samples = self.sample(withReplacement, fraction, rand.randint(0,sys.maxint)).collect()
387+
samples = self.sample(withReplacement, fraction, rand.randint(0, sys.maxint)).collect()
388388

389-
sampler = RDDSampler(withReplacement, fraction, rand.randint(0,sys.maxint))
389+
sampler = RDDSampler(withReplacement, fraction, rand.randint(0, sys.maxint))
390390
sampler.shuffle(samples)
391391
return samples[0:total]
392392

python/pyspark/rddsampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, withReplacement, fraction, seed=None):
2727
print >> sys.stderr, "NumPy does not appear to be installed. Falling back to default random generator for sampling."
2828
self._use_numpy = False
2929

30-
self._seed = seed if seed is not None else random.randint(0,sys.maxint)
30+
self._seed = seed if seed is not None else random.randint(0, sys.maxint)
3131
self._withReplacement = withReplacement
3232
self._fraction = fraction
3333
self._random = None

0 commit comments

Comments
 (0)