package com.bjsxt.spark.others;
import java.util.Arrays;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
public class CheckPointTest {
public static void main(String[] args) {
SparkConf conf = new SparkConf();
conf.setMaster("local").setAppName("checkpoint");
JavaSparkContext sc = new JavaSparkContext(conf);
sc.setCheckpointDir("./checkpoint");
JavaRDD<String> parallelize = sc.parallelize(Arrays.asList("hello","world","bjsxt"));
parallelize.checkpoint();
parallelize.count();
sc.stop();
}
}