Project: mesos
Issue MESOS-3892: Add a helper function to the Agent to retrieve the list of executors that are using optimistically offered, revocable resources.
In the agent, add a helper function to get the list of the exeuctor using ALLOCATION_SLACK. It's short term solution which is different the design document, because master did not have executor for command line executor. Send evicatble executors from master to slave will addess in post-MVP after MESOS-1718. {noformat} class Slave { ... // If the executor used revocable resources, add it into `evictableExecutors` // list. void addEvictableExecutor(Executor* executor); // If the executor used revocable resources, remove it from // `evictableExecutors` list. void removeEvictableExecutor(Executor* executor); // Get evictable executor ID list by `request resources`. The return value is `Result>`: // - if `isError()`, there's not enough resources to launch tasks // - if `isNone()`, no evictable exectuors need to be terminated // - if !`isNone()`, the list of executors that need to be evicted for resources Result> getEvictableExecutors(const Resources& request); ... // The map of evictable executor list. If there's not enough resources, // the evictable executor will be terminated by slave to release resources. hashmap> evictableExecutors; ... } {noformat}
Story points: 5