Class RoundRobinScheduler

java.lang.Object
org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler
All Implemented Interfaces:
IScheduler

public class RoundRobinScheduler extends Object implements IScheduler
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.pulsar.functions.proto.Function.Assignment>
    rebalance(List<org.apache.pulsar.functions.proto.Function.Assignment> currentAssignments, Set<String> workers)
    Rebalances function instances scheduled to workers.
    List<org.apache.pulsar.functions.proto.Function.Assignment>
    schedule(List<org.apache.pulsar.functions.proto.Function.Instance> unassignedFunctionInstances, List<org.apache.pulsar.functions.proto.Function.Assignment> currentAssignments, Set<String> workers)
    Scheduler schedules assignments to appropriate workers and adds into #resultAssignments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RoundRobinScheduler

      public RoundRobinScheduler()
  • Method Details

    • schedule

      public List<org.apache.pulsar.functions.proto.Function.Assignment> schedule(List<org.apache.pulsar.functions.proto.Function.Instance> unassignedFunctionInstances, List<org.apache.pulsar.functions.proto.Function.Assignment> currentAssignments, Set<String> workers)
      Description copied from interface: IScheduler
      Scheduler schedules assignments to appropriate workers and adds into #resultAssignments.
      Specified by:
      schedule in interface IScheduler
      Parameters:
      unassignedFunctionInstances - all unassigned instances
      currentAssignments - current assignments
      workers - current list of active workers
      Returns:
      A list of new assignments
    • rebalance

      public List<org.apache.pulsar.functions.proto.Function.Assignment> rebalance(List<org.apache.pulsar.functions.proto.Function.Assignment> currentAssignments, Set<String> workers)
      Description copied from interface: IScheduler
      Rebalances function instances scheduled to workers.
      Specified by:
      rebalance in interface IScheduler
      Parameters:
      currentAssignments - current assignments
      workers - current list of active workers
      Returns:
      A list of new assignments