Skip to content

Commit

Permalink
Clean up some comments, remove a TODO that is not applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Hartog committed Jun 27, 2016
1 parent a936a48 commit 0952c4b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions storm/src/main/storm/mesos/schedulers/DefaultScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,20 @@ private List<MesosWorkerSlot> getMesosWorkerSlots(Map<String, AggregatedOffers>
*
* Note:
* 1. "MesosWorkerSlot" is the same as WorkerSlot except that it is dedicated for a topology upon creation. This means that,
* a MesosWorkerSlot belonging to one topology cannot be used to launch a worker belonging to a different topology.
* a MesosWorkerSlot belonging to one topology cannot be used to launch a worker belonging to a different topology.
* 2. Please note that this method is called before schedule is invoked. We use this opportunity to assign the MesosWorkerSlot
* to a specific topology and store the state in "mesosWorkerSlotMap". This way, when Storm later calls schedule, we can just
* look up the "mesosWorkerSlotMap" for a list of available slots for the particular topology.
* to a specific topology and store the state in "mesosWorkerSlotMap". This way, when Storm later calls schedule, we can just
* look up the "mesosWorkerSlotMap" for a list of available slots for the particular topology.
* 3. Given MesosWorkerSlot extends WorkerSlot, we shouldn't have to really create a "mesosWorkerSlotMap". Instead, in the schedule
* method, we could have just upcasted the "WorkerSlot" to "MesosWorkerSlot". But this is not currently possible because storm
* passes a recreated version of WorkerSlot to schedule method instead of passing the WorkerSlot returned by this method as is.
* method, we could have just upcasted the "WorkerSlot" to "MesosWorkerSlot". But this is not currently possible because storm
* passes a recreated version of WorkerSlot to schedule method instead of passing the WorkerSlot returned by this method as is.
*/
@Override
public List<WorkerSlot> allSlotsAvailableForScheduling(RotatingMap<Protos.OfferID, Protos.Offer> offers,
Collection<SupervisorDetails> existingSupervisors,
Topologies topologies, Set<String> topologiesMissingAssignments) {
if (topologiesMissingAssignments.isEmpty()) {
log.info("Declining all offers that are currently buffered because no topologies need assignments");
// TODO(ksoundararaj): Do we need to clear offers not that consolidate resources?
offers.clear();
return new ArrayList<>();
}
Expand Down

0 comments on commit 0952c4b

Please sign in to comment.