Class RoundRobinScheduler
java.lang.Object
org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler
- All Implemented Interfaces:
IScheduler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<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.
-
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:ISchedulerScheduler schedules assignments to appropriate workers and adds into #resultAssignments.- Specified by:
schedulein interfaceIScheduler- Parameters:
unassignedFunctionInstances- all unassigned instancescurrentAssignments- current assignmentsworkers- 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:ISchedulerRebalances function instances scheduled to workers.- Specified by:
rebalancein interfaceIScheduler- Parameters:
currentAssignments- current assignmentsworkers- current list of active workers- Returns:
- A list of new assignments
-