Skip to content

Commit

Permalink
Addressed more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liyinan926 committed Dec 25, 2017
1 parent 9d9c841 commit c51bc56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ private[spark] object Config extends Logging {
ConfigBuilder("spark.kubernetes.mountDependencies.timeout")
.doc("Timeout before aborting the attempt to download and unpack dependencies from remote " +
"locations into the driver and executor pods.")
.timeConf(TimeUnit.MINUTES)
.createWithDefault(5)
.timeConf(TimeUnit.SECONDS)
.createWithDefault(300)

val INIT_CONTAINER_MAX_THREAD_POOL_SIZE =
ConfigBuilder("spark.kubernetes.mountDependencies.maxSimultaneousDownloads")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private[spark] class DriverConfigOrchestrator(
Nil
}

val initContainerBootstrapStep = if (areAnyFilesNonContainerLocal(sparkJars ++ sparkFiles)) {
val initContainerBootstrapStep = if (existNonContainerLocalFiles(sparkJars ++ sparkFiles)) {
val orchestrator = new InitContainerConfigOrchestrator(
sparkJars,
sparkFiles,
Expand Down Expand Up @@ -162,7 +162,7 @@ private[spark] class DriverConfigOrchestrator(
mountSecretsStep
}

private def areAnyFilesNonContainerLocal(files: Seq[String]): Boolean = {
private def existNonContainerLocalFiles(files: Seq[String]): Boolean = {
files.exists { uri =>
Utils.resolveURI(uri).getScheme != "local"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ private[spark] class SparkPodInitContainer(
private def downloadFiles(
filesCommaSeparated: Option[String],
downloadDir: File,
errMessageOnDestinationNotADirectory: String): Unit = {
errMessage: String): Unit = {
filesCommaSeparated.foreach { files =>
require(downloadDir.isDirectory, errMessageOnDestinationNotADirectory)
require(downloadDir.isDirectory, errMessage)
Utils.stringToSeq(files).foreach { file =>
Future[Unit] {
fileFetcher.fetchFile(file, downloadDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ private[spark] class KubernetesClusterManager extends ExternalClusterManager wit
val initContainerConfigMapKey = sparkConf.get(INIT_CONTAINER_CONFIG_MAP_KEY_CONF)

if (initContainerConfigMap.isEmpty) {
logWarning("The executor's init-container config map was not specified. Executors will " +
logWarning("The executor's init-container config map is not specified. Executors will " +
"therefore not attempt to fetch remote or submitted dependencies.")
}

if (initContainerConfigMapKey.isEmpty) {
logWarning("The executor's init-container config map key was not specified. Executors will " +
logWarning("The executor's init-container config map key is not specified. Executors will " +
"therefore not attempt to fetch remote or submitted dependencies.")
}

Expand Down

0 comments on commit c51bc56

Please sign in to comment.