Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Scheduling customized interface (version 0.9.5 and higher)

zhaiyuyong edited this page Oct 16, 2014 · 1 revision

From JStorm 0.9.0,JStorm provides a very powerful scheduling features, meet most needs Basically. Before learning how to use the new scheduling,Please to learn what features provided by the introduction of JStorm 0.9.0

Interface

Set the default memory size for each worker

     ConfigExtension.setMemSizePerWorker(Map conf, long memSize)

Set weights for each worker's cgroup, cpu

     ConfigExtension.setCpuSlotNumPerWorker(Map conf, int slotNum)

Set whether to use the old distribution

     ConfigExtension.setUseOldAssignment(Map conf, boolean useOld)

Set to force one component of the task to work on different nodes

     ConfigExtension.setTaskOnDifferentNode(Map conf, boolean isIsolate)

Custom worker assigned

     WorkerAssignment worker = new WorkerAssignment();
     worker.addComponent(String compenentName, Integer num);      //Add a task on this worker
     worker.setHostName(String hostName);      //force this worker on one machine 
     worker.setJvm(String jvm);                //Set jvm parameters of this worker
     worker.setMem(long mem);                  //Set the worker's memory size
     worker.setCpu(int slotNum);               //Set the cpu's weights
     ConfigExtension.setUserDefineAssignment(Map conf, List<WorkerAssignment> userDefines)

PS:Each worker's argument does not need to be all set,Under the premise that worker attributes in the legal premise, even if only to set up some parameters will still take effect.

Scheduling Rules

  •      Worker is the dimension for task scheduling algorithm.
    
  •      The scheduling operation in the Scheduling progress will not affect the operation of the scheduler has occurred
    
  •      Users can customize useDefined Assignment and use existing old Assignment in the Scheduling progress,The priority of both is:useDefined Assignment>old Assignment
    
  •      Users can set the parameter of task.on.differ.node,Force the tasks of the same component to be distributed to different supervisors.
    

The default scheduling algorithm

  •        In worker dimension,Try to allocation worker to each supervisor average
    
  •        In worker units,Confirm the correspond relation between worker and task's size(Note that this has previously been occupied by other topologies using the worker no longer participate in this action)
    
  •        The priority of task-worker is :Try to avoid the same task in the same work, and the same supervisor, Try to ensure that allocation task on the worker and supervisor benchmark average,Try to ensure that there is a direct flow of information transmission task at the same worker
    
Clone this wiki locally