Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/11129#discussion_r53124448
--- Diff:
yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
@@ -307,8 +307,14 @@ private[yarn] class YarnAllocator(
nodes: Array[String],
racks: Array[String]): ContainerRequest = {
nodeLabelConstructor.map { constructor =>
+ val labelExp = if ((racks != null && (!racks.isEmpty))
+ || (nodes != null && (!nodes.isEmpty))) {
+ null
+ } else {
+ labelExpression.orNull
+ }
constructor.newInstance(resource, nodes, racks, RM_REQUEST_PRIORITY,
true: java.lang.Boolean,
- labelExpression.orNull)
+ labelExp)
--- End diff --
From my understanding, currently in your implementation if `nodes` or
`racks` is not empty, label expression will not be worked even it is explicitly
set through configuration.
IMO I would choose to set `nodes` and `racks` to null if label expression
is configured, otherwise user will be confused why explicitly setting lab
expression is not worked.
---
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]