Storm series (vi) scheduler-Scheduler [Eventscheduler]

Source: Internet
Author: User

Task Scheduler Interface Definition:

1 IScheduler {
2 // conf for the STORMP configuration of the current Nimbus
3 void Prepare (Map conf); // Initialize
4 // topologyies represents all topology information in the cluster, cluster indicates that the current cluster includes all the resources (Supervisor, Solt, and task assignments) required by the user to customize the dispatch logic.
5 void Schedule (topologies topologies,cluster Cluster);
6 };

Eventscheduler

Implementation Flowchart:

Function: The scheduler that distributes the resources evenly, realizes the IScheduler interface, the schedule method realizes the following

1 defn– schedule[This ^topologies topologyies ^ Cluster Cluster]
2 (Schedule-topologies-evenly topologies cluster)

Schedule-topologies-evenly Method Prototypes:

1 defn Schedule-topologies-evenly[^topologies topologies ^ Cluster Cluster]

Method Description:

    1. Call the Needsschedulingtopology method of the cluster object to get the topology collection that needs to be scheduled for the task, based on: Topology sets whether the number of numworkers is greater than the number of workers already assigned to the topology, and whether the topology has not been assigned more than 0 executor.
    2. Topology gets its topology-id for the task that needs to be dispatched, and then calls the Schedule-topology method to get to the New-assignment (<executor,node+port> collection).
    3. Constructs a Workerslot object with node and port information and will act as a slot.
    4. Constructs a Executordetail object for each item in the executor collection, and returns a Executordetails collection.
    5. Call cluster's Assign method to assign the computed slot to the executors corresponding to the topology.

Schedule-topology

Method Prototypes:

1 defn - Schedule- topology [^topologydetails topology ~ Cluster Cluster]

Method Description:

    1. Call cluster's Getavailableslots method to get the slot resources available for the current cluster (supervisor ports that are not in use in the cluster) and convert to <node,port> collection (available-slots).
    2. Converts the Executordetails collection in topology to the <start-task-id,end-task-id> collection.
    3. Call the Get-alive-assigned-node+port->executors method to get the current topology already allocated resource condition, return <node+port,executors> collection ( alive-assigned).
    4. Gets the number of slots that can be used by the current topology, topology sets the number of workers and the current available-slots number plus the minimum value of the alive-assigned data (total-slots-to-use).
    5. Sort the available-slots, calculate the number of solt that need to be allocated (Total-slots-to-use minus alive-assigned), get Solt in order from the sorted Solt to Reassign-solts .
    6. Compare the differences between the all-executors and the allocated executor collection to get the executor collection that needs to be allocated as reassign-executors.
    7. The computed reassign-solts is associated with the Reassign-executor and converted to the <executor,slot> map collection (mapped by: To make the executor evenly distributed on the slot), Saved to Ressignment.

Storm series (vi) scheduler-Scheduler [Eventscheduler]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.