The PySpark StorageLevel is used to control the storage of RDD. It controls how and where the RDD is stored. PySpark StorageLevel decides if the RDD is stored on the memory, over the disk, or both. It also specifies whether we need to replicate the RDD partitions or serialize the RDD.
Following is the code for PySpark StorageLevel:
class pyspark.StorageLevel( useDisk, useMemory, useOfHeap, deserialized, replication = 1)