Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5242#discussion_r28188996
--- Diff:
yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
@@ -117,6 +117,24 @@ private[yarn] class YarnAllocator(
// For testing
private val launchContainers =
sparkConf.getBoolean("spark.yarn.launchContainers", true)
+ private val labelExpression =
sparkConf.getOption("spark.yarn.nodeLabelExpression")
+
+ // ContainerRequest constructor that can take a node label expression.
We grab it through
+ // reflection because it's only available in later versions of YARN.
+ private val nodeLabelConstructor = labelExpression.flatMap { expr =>
+ try {
+ Some(classOf[ContainerRequest].getConstructor(classOf[Resource],
--- End diff --
Looks correct to me. From the hadoop code:
public ContainerRequest(Resource capability, String[] nodes,
String[] racks, Priority priority, boolean relaxLocality) {
this(capability, nodes, racks, priority, relaxLocality, null);
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]