Package org.apache.spark.storage
Class BlockReplicationUtils
Object
org.apache.spark.storage.BlockReplicationUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> scala.collection.immutable.List<T>
getRandomSample
(scala.collection.immutable.Seq<T> elems, int m, scala.util.Random r) Get a random sample of size m from the elems
-
Constructor Details
-
BlockReplicationUtils
public BlockReplicationUtils()
-
-
Method Details
-
getRandomSample
public static <T> scala.collection.immutable.List<T> getRandomSample(scala.collection.immutable.Seq<T> elems, int m, scala.util.Random r) Get a random sample of size m from the elems- Parameters:
elems
-m
- number of samples neededr
- random number generator- Returns:
- a random list of size m. If there are fewer than m elements in elems, we just randomly shuffle elems
-