Contenuto principale

cache

R2026b

Class: matlab.compiler.mlspark.RDD
Namespace: matlab.compiler.mlspark

(To be removed) Store an RDD in memory

matlab.compiler.mlspark.RDD.cache will be removed in a future release. There is no replacement functionality. For more information, see Version History.

Syntax

cache(obj)

Description

cache(obj) stores an RDD object specified by obj in the memory of the executors across a cluster.

Input Arguments

expand all

An RDD to be cached in memory, specified as an RDD object.

Examples

expand all

Store an RDD in the memory of the executors across the cluster.

%% Connect to Spark
sparkProp = containers.Map({'spark.executor.cores'}, {'1'});
conf = matlab.compiler.mlspark.SparkConf('AppName','myApp', ...
                        'Master','local[1]','SparkProperties',sparkProp);
sc = matlab.compiler.mlspark.SparkContext(conf);

%% cache
myFile = sc.textFile('airlinesmall.csv');
myFile.cache();

Version History

Introduced in R2016b

collapse all

See Also