Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review comments
  • Loading branch information
kiszk committed May 9, 2018
commit 9a6377bf5b5943db98900f5dd18a0222cd699d58
17 changes: 7 additions & 10 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ private[spark] object SparkSubmitUtils {
"1.0"))

/**
* clear ivy resolution from current launch. The resolution file is usually at
* Clear ivy resolution from current launch. The resolution file is usually at
* ~/.ivy2/org.apache.spark-spark-submit-parent-$UUID-default.xml,
* ~/.ivy2/resolved-org.apache.spark-spark-submit-parent-$UUID-1.0.xml, and
* ~/.ivy2/resolved-org.apache.spark-spark-submit-parent-$UUID-1.0.properties.
Expand All @@ -1223,16 +1223,13 @@ private[spark] object SparkSubmitUtils {
mdId: ModuleRevisionId,
ivySettings: IvySettings,
ivyConfName: String): Unit = {
val currentResolutionFiles = Seq[File](
new File(ivySettings.getDefaultCache,
s"${mdId.getOrganisation}-${mdId.getName}-$ivyConfName.xml"),
new File(ivySettings.getDefaultCache,
s"resolved-${mdId.getOrganisation}-${mdId.getName}-${mdId.getRevision}.xml"),
new File(ivySettings.getDefaultCache,
s"resolved-${mdId.getOrganisation}-${mdId.getName}-${mdId.getRevision}.properties")
val currentResolutionFiles = Seq(
s"${mdId.getOrganisation}-${mdId.getName}-$ivyConfName.xml",
s"resolved-${mdId.getOrganisation}-${mdId.getName}-${mdId.getRevision}.xml",
s"resolved-${mdId.getOrganisation}-${mdId.getName}-${mdId.getRevision}.properties"
)
currentResolutionFiles.foreach { file =>
file.delete()
currentResolutionFiles.foreach { filename =>
new File(ivySettings.getDefaultCache, filename).delete()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,8 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll {
ivySettings,
isTest = true)
val r = """.*org.apache.spark-spark-submit-parent-.*""".r
assert(ivySettings.getDefaultCache.listFiles.map(_.getName)
.forall { case n @ r() => false case _ => true },
"resolution files should be cleaned")
assert(!ivySettings.getDefaultCache.listFiles.map(_.getName)
.exists(r.findFirstIn(_).isDefined), "resolution files should be cleaned")
}
}
}