Skip to content

Commit c0cbc75

Browse files
author
Ankur Chauhan
committed
Use offer id value for debug message
1 parent 7fee0ea commit c0cbc75

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ private[spark] class CoarseMesosSchedulerBackend(
181181
val slaveId = offer.getSlaveId.toString
182182
val mem = getResource(offer.getResourcesList, "mem")
183183
val cpus = getResource(offer.getResourcesList, "cpus").toInt
184+
val id = offer.getId.getValue
184185
if (meetsConstraints &&
185186
totalCoresAcquired < maxCores &&
186187
mem >= calculateTotalMemory(sc) &&
@@ -208,11 +209,11 @@ private[spark] class CoarseMesosSchedulerBackend(
208209
}
209210

210211
// accept the offer and launch the task
211-
logDebug(s"Accepting offer: ${offer.getId} with attributes: $offerAttributes mem: $mem cpu: $cpus")
212+
logDebug(s"Accepting offer: $id with attributes: $offerAttributes mem: $mem cpu: $cpus")
212213
d.launchTasks(List(offer.getId), List(task.build()), filters)
213214
} else {
214215
// Decline the offer
215-
logDebug(s"Declining offer: ${offer.getId} with attributes: $offerAttributes mem: $mem cpu: $cpus")
216+
logDebug(s"Declining offer: $id with attributes: $offerAttributes mem: $mem cpu: $cpus")
216217
d.declineOffer(offer.getId)
217218
}
218219
}

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ private[spark] class MesosSchedulerBackend(
209209

210210
// add some debug messaging
211211
val debugStatement = if(meetsRequirements) "Accepting" else "Declining"
212-
logDebug(s"$debugStatement offer: ${o.getId} with attributes: $offerAttributes mem: $mem cpu: $cpus")
212+
val id = o.getId.getValue
213+
logDebug(s"$debugStatement offer: $id with attributes: $offerAttributes mem: $mem cpu: $cpus")
213214

214215
meetsRequirements
215216
}

0 commit comments

Comments
 (0)