|Constructor and Description|
|Modifier and Type||Method and Description|
This method is invoked to calculate a scheduling for topology td.
Sort objects by the following two criteria.
findWorkerForExec, getSpouts, hostnameToNodes, idToNode, makeHostToNodeIds, mkNotEnoughResources, nodeToRack, orderExecutors, prepare, scheduleExecutor, sortAllNodes, sortNodes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SchedulingResult schedule(Cluster cluster, TopologyDetails td)
This method is invoked to calculate a scheduling for topology td. Cluster will reject any changes that are not for the given topology. Any changes made to the cluster will be committed if the scheduling is successful.NOTE: scheduling occurs as a runnable in an interruptible thread. Scheduling should consider being interrupted if long running.
protected TreeSet<BaseResourceAwareStrategy.ObjectResources> sortObjectResources(BaseResourceAwareStrategy.AllResources allResources, ExecutorDetails exec, TopologyDetails topologyDetails, BaseResourceAwareStrategy.ExistingScheduleFunc existingScheduleFunc)
Sort objects by the following two criteria. 1) the number executors of the topology that needs to be scheduled is already on the object (node or rack) in descending order. The reasoning to sort based on criterion 1 is so we schedule the rest of a topology on the same object (node or rack) as the existing executors of the topology. 2) the subordinate/subservient resource availability percentage of a rack in descending order We calculate the resource availability percentage by dividing the resource availability of the object (node or rack) by the resource availability of the entire rack or cluster depending on if object references a node or a rack. By doing this calculation, objects (node or rack) that have exhausted or little of one of the resources mentioned above will be ranked after racks that have more balanced resource availability. So we will be less likely to pick a rack that have a lot of one resource but a low amount of another.
Copyright © 2019 The Apache Software Foundation. All rights reserved.