Main Content

checkpoint

R2026b

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

(To be removed) Mark an RDD for checkpointing

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

Syntax

checkpoint(obj)

Description

checkpoint(obj) marks an RDD for checkpointing.

Input Arguments

expand all

An input RDD that is to be marked for checkpointing, specified as an RDD object.

Examples

expand all

Use the checkpoint method to save an RDD to a file inside the checkpoint directory.

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

%% checkpoint
sc.setCheckpointDir('myDir')
myFile = sc.parallelize({1,2,3});
mapRDD = myFile.map(@(x)({x,1}));
mapRDD.checkpoint();

Version History

Introduced in R2016b

collapse all