Callback interface to be implemented by frameworks' schedulers. Note that only one callback will be invoked at a time, so it is not recommended that you block within a callback because it may cause a deadlock. Each callback includes a reference to the scheduler driver that was used to run this s
| 38 | * itself. |
| 39 | */ |
| 40 | public interface Scheduler { |
| 41 | /** |
| 42 | * Invoked when the scheduler successfully registers with a Mesos |
| 43 | * master. A unique ID (generated by the master) used for |
| 44 | * distinguishing this framework from others and MasterInfo |
| 45 | * with the IP and port of the current master are provided as arguments. |
| 46 | * |
| 47 | * @param driver The scheduler driver that was registered. |
| 48 | * @param frameworkId The framework ID generated by the master. |
| 49 | * @param masterInfo Info about the current master, including IP and port. |
| 50 | * |
| 51 | * @see SchedulerDriver |
| 52 | * @see FrameworkID |
| 53 | * @see MasterInfo |
| 54 | */ |
| 55 | void registered(SchedulerDriver driver, |
| 56 | FrameworkID frameworkId, |
| 57 | MasterInfo masterInfo); |
| 58 | |
| 59 | /** |
| 60 | * Invoked when the scheduler reregisters with a newly elected Mesos master. |
| 61 | * This is only called when the scheduler has previously been registered. |
| 62 | * MasterInfo containing the updated information about the elected master |
| 63 | * is provided as an argument. |
| 64 | * |
| 65 | * @param driver The driver that was reregistered. |
| 66 | * @param masterInfo The updated information about the elected master. |
| 67 | * |
| 68 | * @see SchedulerDriver |
| 69 | * @see MasterInfo |
| 70 | */ |
| 71 | void reregistered(SchedulerDriver driver, MasterInfo masterInfo); |
| 72 | |
| 73 | /** |
| 74 | * Invoked when resources have been offered to this framework. A |
| 75 | * single offer will only contain resources from a single slave. |
| 76 | * Resources associated with an offer will not be re-offered to |
| 77 | * _this_ framework until either (a) this framework has rejected |
| 78 | * those resources (see {@link SchedulerDriver#launchTasks}) or (b) |
| 79 | * those resources have been rescinded (see {@link Scheduler#offerRescinded}). |
| 80 | * Note that resources may be concurrently offered to more than one |
| 81 | * framework at a time (depending on the allocator being used). In |
| 82 | * that case, the first framework to launch tasks using those |
| 83 | * resources will be able to use them while the other frameworks |
| 84 | * will have those resources rescinded (or if a framework has |
| 85 | * already launched tasks with those resources then those tasks will |
| 86 | * fail with a TASK_LOST status and a message saying as much). |
| 87 | * |
| 88 | * @param driver The driver that was used to run this scheduler. |
| 89 | * @param offers The resources offered to this framework. |
| 90 | * |
| 91 | * @see SchedulerDriver |
| 92 | * @see Offer |
| 93 | */ |
| 94 | void resourceOffers(SchedulerDriver driver, List<Offer> offers); |
| 95 | |
| 96 | /** |
| 97 | * Invoked when an offer is no longer valid (e.g., the slave was |
no outgoing calls
no test coverage detected