Class: matlab.compiler.mlspark.RDD Package: matlab.compiler.mlspark
Mark an RDD for checkpointing
checkpoint(obj)
checkpoint(obj) marks an RDD for checkpointing.
obj
expand all
RDD
An input RDD that is to be marked for checkpointing, specified as an RDD object.
Use the checkpoint method to save an RDD to a file inside the checkpoint directory.
checkpoint
%% 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();
getCheckpointFile | map | parallelize | setCheckpointDir
getCheckpointFile
map
parallelize
setCheckpointDir