Class: matlab.compiler.mlspark.RDD Package: matlab.compiler.mlspark
Store an RDD in memory
cache(obj)
cache(obj) stores an RDD object specified by obj in the memory of the executors across a cluster.
obj
expand all
RDD
An RDD to be cached in memory, specified as an RDD object.
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();
textFile