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
Next Next commit
nits
  • Loading branch information
HyukjinKwon committed Nov 25, 2020
commit 5b1d1c3db6c1ce68a2738dec9b54af519b026b42
6 changes: 5 additions & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import org.apache.hadoop.mapred.{FileInputFormat, InputFormat, JobConf, Sequence
import org.apache.hadoop.mapreduce.{InputFormat => NewInputFormat, Job => NewHadoopJob}
import org.apache.hadoop.mapreduce.lib.input.{FileInputFormat => NewFileInputFormat}

import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.annotation.{DeveloperApi, Experimental}
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.deploy.{LocalSparkCluster, SparkHadoopUtil}
import org.apache.spark.executor.{Executor, ExecutorMetrics, ExecutorMetricsSource}
Expand Down Expand Up @@ -1533,6 +1533,7 @@ class SparkContext(config: SparkConf) extends Logging {
def listFiles(): Seq[String] = addedFiles.keySet.toSeq

/**
* :: Experimental ::
* Add an archive to be downloaded and unpacked with this Spark job on every node.
*
* If an archive is added during execution, it will not be available until the next TaskSet
Expand All @@ -1547,15 +1548,18 @@ class SparkContext(config: SparkConf) extends Logging {
*
* @since 3.1.0
*/
@Experimental
def addArchive(path: String): Unit = {
addFile(path, false, false, isArchive = true)
}

/**
* :: Experimental ::
* Returns a list of archive paths that are added to resources.
*
* @since 3.1.0
*/
@Experimental
def listArchives(): Seq[String] = addedArchives.keySet.toSeq

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ private[spark] object Utils extends Logging {
lowerSrc.endsWith(".tar.gz") || lowerSrc.endsWith(".tgz") || lowerSrc.endsWith(".tar")) {
FileUtil.unTar(source, dest)
} else {
logWarning("Cannot unpack " + source)
logWarning(s"Cannot unpack $source, just copying it to $dest.")
copyRecursive(source, dest)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class SparkSubmitSuite
sys.props("SPARK_SUBMIT") should be ("true")
}

test("SPARK-33530: handles standalone mode") {
test("SPARK-33530: handles standalone mode with archives") {
val clArgs = Seq(
"--master", "spark://localhost:1234",
"--executor-memory", "5g",
Expand All @@ -356,7 +356,6 @@ class SparkSubmitSuite
childArgsStr should include ("arg1 arg2")
mainClass should be ("org.SomeClass")

// In yarn cluster mode, also adding jars to classpath
classpath(0) should endWith ("thejar.jar")
classpath(1) should endWith ("one.jar")
classpath(2) should endWith ("two.jar")
Expand Down