Package org.apache.spark.storage
Class StorageLevel
Object
org.apache.spark.storage.StorageLevel
- All Implemented Interfaces:
Externalizable
,Serializable
:: DeveloperApi ::
Flags for controlling the storage of an RDD. Each StorageLevel records whether to use memory,
or ExternalBlockStore, whether to drop the RDD to disk if it falls out of memory or
ExternalBlockStore, whether to keep the data in memory in a serialized format, and whether
to replicate the RDD partitions on multiple nodes.
The StorageLevel
singleton object contains some static constants
for commonly useful storage levels. To create your own storage level object, use the
factory method of the singleton object (StorageLevel(...)
).
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StorageLevel
apply
(boolean useDisk, boolean useMemory, boolean useOffHeap, boolean deserialized, int replication) :: DeveloperApi :: Create a new StorageLevel object.static StorageLevel
apply
(boolean useDisk, boolean useMemory, boolean deserialized, int replication) :: DeveloperApi :: Create a new StorageLevel object without setting useOffHeap.static StorageLevel
apply
(int flags, int replication) :: DeveloperApi :: Create a new StorageLevel object from its integer representation.static StorageLevel
apply
(ObjectInput in) :: DeveloperApi :: Read StorageLevel object from ObjectInput stream.clone()
boolean
static StorageLevel
static StorageLevel
static StorageLevel
boolean
static StorageLevel
fromString
(String s) :: DeveloperApi :: Return the StorageLevel object with the specified name.int
hashCode()
boolean
isValid()
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
static StorageLevel
NONE()
VariousStorageLevel
defined and utility functions for creating new storage levels.static StorageLevel
OFF_HEAP()
void
int
int
toInt()
toString()
boolean
useDisk()
boolean
boolean
void
-
Constructor Details
-
StorageLevel
public StorageLevel()
-
-
Method Details
-
NONE
VariousStorageLevel
defined and utility functions for creating new storage levels.- Returns:
- (undocumented)
-
DISK_ONLY
-
DISK_ONLY_2
-
DISK_ONLY_3
-
MEMORY_ONLY
-
MEMORY_ONLY_2
-
MEMORY_ONLY_SER
-
MEMORY_ONLY_SER_2
-
MEMORY_AND_DISK
-
MEMORY_AND_DISK_2
-
MEMORY_AND_DISK_SER
-
MEMORY_AND_DISK_SER_2
-
OFF_HEAP
-
fromString
:: DeveloperApi :: Return the StorageLevel object with the specified name.- Parameters:
s
- (undocumented)- Returns:
- (undocumented)
-
apply
public static StorageLevel apply(boolean useDisk, boolean useMemory, boolean useOffHeap, boolean deserialized, int replication) :: DeveloperApi :: Create a new StorageLevel object.- Parameters:
useDisk
- (undocumented)useMemory
- (undocumented)useOffHeap
- (undocumented)deserialized
- (undocumented)replication
- (undocumented)- Returns:
- (undocumented)
-
apply
public static StorageLevel apply(boolean useDisk, boolean useMemory, boolean deserialized, int replication) :: DeveloperApi :: Create a new StorageLevel object without setting useOffHeap.- Parameters:
useDisk
- (undocumented)useMemory
- (undocumented)deserialized
- (undocumented)replication
- (undocumented)- Returns:
- (undocumented)
-
apply
:: DeveloperApi :: Create a new StorageLevel object from its integer representation.- Parameters:
flags
- (undocumented)replication
- (undocumented)- Returns:
- (undocumented)
-
apply
:: DeveloperApi :: Read StorageLevel object from ObjectInput stream.- Parameters:
in
- (undocumented)- Returns:
- (undocumented)
-
useDisk
public boolean useDisk() -
useMemory
public boolean useMemory() -
useOffHeap
public boolean useOffHeap() -
deserialized
public boolean deserialized() -
replication
public int replication() -
clone
-
equals
-
isValid
public boolean isValid() -
toInt
public int toInt() -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
-
toString
-
hashCode
public int hashCode() -
description
-