Apache Spark does not delete temporary directories

前端 未结 6 539
庸人自扰
庸人自扰 2020-11-27 15:48

After a spark program completes, there are 3 temporary directories remain in the temp directory. The directory names are like this: spark-2e389487-40cc-4a82-a5c7-353c0feefbb

6条回答
  •  孤街浪徒
    2020-11-27 16:41

    I assume you are using the "local" mode only for testing purposes. I solved this issue by creating a custom temp folder before running a test and then I delete it manually (in my case I use local mode in JUnit so the temp folder is deleted automatically).

    You can change the path to the temp folder for Spark by spark.local.dir property.

    SparkConf conf = new SparkConf().setMaster("local")
                                    .setAppName("test")
                                    .set("spark.local.dir", "/tmp/spark-temp");
    

    After the test is completed I would delete the /tmp/spark-temp folder manually.

提交回复
热议问题