Class BlockReplicationUtils

Object
org.apache.spark.storage.BlockReplicationUtils

public class BlockReplicationUtils extends Object
  • 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 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