public class SchedulingResult
extends java.lang.Object
scheduleOnce()
.
You can use this object to get a map of which tasks the task scheduler assigned to which virtual machines, and then you can use this assignment map to launch the assigned tasks via Mesos.
You can also use the list of task assignment failures that is available through this object to make an additional attempt to launch those tasks on your next scheduling loop or to modify the state of the system to make it more amenable to the failed tasks.
Constructor and Description |
---|
SchedulingResult(java.util.Map<java.lang.String,VMAssignmentResult> resultMap) |
Modifier and Type | Method and Description |
---|---|
void |
addException(java.lang.Exception e) |
java.util.List<java.lang.Exception> |
getExceptions() |
java.util.Map<TaskRequest,java.util.List<TaskAssignmentResult>> |
getFailures()
Get the unsuccessful task assignment result map.
|
int |
getIdleVMsCount()
Get the number of hosts (virtual machines) that are idle at the end of this scheduling trial.
|
int |
getLeasesAdded()
Get the number of leases (resource offers) added during this scheduling trial.
|
int |
getLeasesRejected()
Get the number of leases (resource offers) rejected during this scheduling trial.
|
int |
getNumAllocations()
Get the number of resource allocations performed during this scheduling trial.
|
java.util.Map<java.lang.String,VMAssignmentResult> |
getResultMap()
Get the successful task assignment result map.
|
long |
getRuntime()
Get the time elapsed, in milliseconds, during this scheduling trial.
|
int |
getTotalVMsCount()
Get the total number of hosts (virtual machines) known during this scheduling trial.
|
java.lang.String |
toString() |
public SchedulingResult(java.util.Map<java.lang.String,VMAssignmentResult> resultMap)
public java.util.Map<java.lang.String,VMAssignmentResult> getResultMap()
Fenzo removes these offers from its internal state when you get this result. Normally, you would use these offers
immediately to launch the tasks. For any reason if you do not use the offers to launch those tasks, you must either
reject the offers to Mesos, or, re-add them to Fenzo with the next call to
TaskScheduler.scheduleOnce(List, List)
. Otherwise, those offers would be "leaked out".
public void addException(java.lang.Exception e)
public java.util.List<java.lang.Exception> getExceptions()
public java.util.Map<TaskRequest,java.util.List<TaskAssignmentResult>> getFailures()
public int getLeasesAdded()
public int getLeasesRejected()
public long getRuntime()
public int getNumAllocations()
public int getTotalVMsCount()
public int getIdleVMsCount()
public java.lang.String toString()
toString
in class java.lang.Object