Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Pass the actual iterable from the option to get files #139

Merged
merged 3 commits into from
Feb 23, 2017

Conversation

mccheah
Copy link

@mccheah mccheah commented Feb 23, 2017

Closes #137

@@ -77,8 +77,12 @@ private[spark] class Client(

def run(): Unit = {
logInfo(s"Starting application $kubernetesAppId in Kubernetes...")
val submitterLocalFiles = KubernetesFileUtils.getOnlySubmitterLocalFiles(sparkFiles)
val submitterLocalJars = KubernetesFileUtils.getOnlySubmitterLocalFiles(sparkJars)
val submitterLocalFiles = KubernetesFileUtils.getOnlySubmitterLocalFiles(sparkFiles
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably try to catch this at the unit test level, not the integration test level.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how you'll catch this at the unit test level -- won't you have to call the run() method to hit this, and won't that pretty much only be done in an integration test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do want to call run() in the unit test however. Might take a decent amount of effort to mock everything, but it's probably the way to go.

val submitterLocalFiles = KubernetesFileUtils.getOnlySubmitterLocalFiles(sparkFiles
.map(_.split(","))
.getOrElse(Array.empty[String]))
val submitterLocalJars = KubernetesFileUtils.getOnlySubmitterLocalFiles(sparkJars
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sparkJars and sparkFiles instance variables here are still in the comma-separated format which is a little unexpected. They also don't have type annotations which maybe could've helped in review.

Maybe we should do the comma-splitting in the first access of spark.files and spark.jars and then annotate the types as Iterable[String] instead of the current implicit Option[String] ?

   private val sparkFiles = sparkConf.getOption("spark.files")
   private val sparkJars = sparkConf.getOption("spark.jars")

@ash211
Copy link

ash211 commented Feb 23, 2017

Merging now, but I'm uncomfortable that we don't have a test that covers this so filed an issue at #141

@ash211 ash211 merged commit 913a60e into k8s-support-alternate-incremental Feb 23, 2017
@ash211 ash211 deleted the fix-files-parsing branch February 23, 2017 20:12
ash211 pushed a commit that referenced this pull request Mar 8, 2017
* Pass the actual iterable from the option to get files

* Split the original instance variables

* Explicitly set the type of the array
foxish pushed a commit that referenced this pull request Jul 24, 2017
* Pass the actual iterable from the option to get files

* Split the original instance variables

* Explicitly set the type of the array
ifilonenko pushed a commit to ifilonenko/spark that referenced this pull request Feb 25, 2019
…n-k8s#139)

* Pass the actual iterable from the option to get files

* Split the original instance variables

* Explicitly set the type of the array

(cherry picked from commit 913a60e)
puneetloya pushed a commit to puneetloya/spark that referenced this pull request Mar 11, 2019
…n-k8s#139)

* Pass the actual iterable from the option to get files

* Split the original instance variables

* Explicitly set the type of the array
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants