File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -193,12 +193,15 @@ private[spark] class Client(
193193 * Cleanup application staging directory.
194194 */
195195 private def cleanupStagingDir (appId : ApplicationId ): Unit = {
196+ if (sparkConf.get(PRESERVE_STAGING_FILES )) {
197+ return
198+ }
199+
196200 def cleanupStagingDirInternal (): Unit = {
197201 val stagingDirPath = new Path (appStagingBaseDir, getAppStagingDir(appId))
198202 try {
199- val preserveFiles = sparkConf.get(PRESERVE_STAGING_FILES )
200203 val fs = stagingDirPath.getFileSystem(hadoopConf)
201- if (! preserveFiles && fs.delete(stagingDirPath, true )) {
204+ if (fs.delete(stagingDirPath, true )) {
202205 logInfo(s " Deleted staging directory $stagingDirPath" )
203206 }
204207 } catch {
You can’t perform that action at this time.
0 commit comments