Github user ArtRand commented on a diff in the pull request:
https://github.com/apache/spark/pull/19390#discussion_r147066762
--- Diff:
resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala
---
@@ -175,17 +176,36 @@ trait MesosSchedulerUtils extends Logging {
registerLatch.countDown()
}
- def createResource(name: String, amount: Double, role: Option[String] =
None): Resource = {
+ private def isNotAnyRole(role: Option[String]): Boolean = {
--- End diff --
I would prefer that this contains all of the logic below (if that's
possible). For example:
```scala
private def setAllocationAndReservationInfo(allocationInfo:
Option[AllocationInfo], reservationInfo: Option[ReservationInfo], role:
Option[String]) = {
if (role.forall(r => !r.equals(ANY_ROLE)) {
allocationInfo.foreach { alloc => builder.setAllocationInfo(alloc) }
reservationInfo.foreach { res => builder.setReservation(res) }
}
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]