repartition(numPartitions)

repartition(numPartitions)

Changes the level of parallelism in this DStream by creating more or fewer partitions.

//Default partition is number of CPU "cores (threads really)" in the machine that runs Spark
getSomeData.rdd.getNumPartitions
val rePartition = getSomeData.repartition(numPartitions = 6)

Last updated