Main Content

unpersist

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

Mark an RDD as nonpersistent, remove all blocks for it from memory and disk

Syntax

unpersist(obj)

Description

unpersist(obj) marks input RDD object as nonpersistent and removes all blocks for it from memory and disk.

Input Arguments

expand all

An input RDD, specified as an RDD object.

Examples

expand all

Use the unpersist method to mark an RDD as nonpersistent.

%% 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);

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

Version History

Introduced in R2016b