Package org.apache.spark.storage
Class BlockReplicationUtils
Object
org.apache.spark.storage.BlockReplicationUtils
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
BlockReplicationUtilspublic BlockReplicationUtils()
 
- 
- 
Method Details- 
getRandomSamplepublic 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 needed
- r- random number generator
- Returns:
- a random list of size m. If there are fewer than m elements in elems, we just randomly shuffle elems
 
 
-