Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-27835][Core] Resource Scheduling: change driver config from addresses #24730

Closed

Conversation

tgravescs
Copy link
Contributor

What changes were proposed in this pull request?

Change the Driver resource discovery argument for standalone mode to be a file rather then separate address configs per resource. This makes it consistent with how the Executor is doing it and makes it more flexible in the future, and it makes for less configs if you have multiple resources.

How was this patch tested?

Unit tests and basic manually testing to make sure files were parsed properly.

@SparkQA
Copy link

SparkQA commented May 28, 2019

Test build #105871 has finished for PR 24730 at commit 6704cb6.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@tgravescs tgravescs changed the title [SPARK-27835] Resource Scheduling: change driver config from addresses [SPARK-27835][Core] Resource Scheduling: change driver config from addresses May 28, 2019
@SparkQA
Copy link

SparkQA commented May 28, 2019

Test build #105872 has finished for PR 24730 at commit c046f07.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class JsonResourceInformation(val name: String, val addresses: Array[String])

} finally {
resourceInput.close()
}
resources.map(r => (r.name, new ResourceInformation(r.name, r.addresses))).toMap
Copy link
Member

Choose a reason for hiding this comment

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

could Seq[JsonResourceInformation] contain duplicated name? might be (very marginally) better to do
resource.toMap.map(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I'm missing what you are saying here with the toMap.map? I can't do the toMap until I do the first map to (name, ResourceInformation), otherwise you just have a Seq[JsonResourceInformation] and toMap doesn't know how to make that a map. If there are 2 resource with the same name when the current code runs the toMap will choose the last one.

I had actually tested this and found the json4s parse and extract actually are handling duplicates as well, looks like it chooses the last one, I couldn't find docs on that behavior though either. The resourcesfile is built by the standalone master/worker so it shouldn't really have duplicates. I'm happy to update though to be explicit so just let me know.

Copy link
Member

Choose a reason for hiding this comment

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

ah yes ;) I just mean it walking through a Seq when the goal is a Map

@felixcheung
Copy link
Member

LGTM

@tgravescs
Copy link
Contributor Author

thanks Felix, merging to master

@asfgit asfgit closed this in 6748b48 May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants