pyspark.
RDDBarrier
Wraps an RDD in a barrier stage, which forces Spark to launch tasks of this stage together. RDDBarrier instances are created by RDD.barrier().
RDD.barrier()
New in version 2.4.0.
Notes
This API is experimental
Methods
mapPartitions(f[, preservesPartitioning])
mapPartitions
Returns a new RDD by applying a function to each partition of the wrapped RDD, where tasks are launched together in a barrier stage.
mapPartitionsWithIndex(f[, …])
mapPartitionsWithIndex
Returns a new RDD by applying a function to each partition of the wrapped RDD, while tracking the index of the original partition.