Interface IScheduler
- All Known Implementing Classes:
RoundRobinScheduler
public interface IScheduler
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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.
-
Method Details
-
schedule
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.- Parameters:
unassignedFunctionInstances- all unassigned instancescurrentAssignments- current assignmentsworkers- current list of active workers- Returns:
- A list of new assignments
-
rebalance
default 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.- Parameters:
currentAssignments- current assignmentsworkers- current list of active workers- Returns:
- A list of new assignments
-