Interface IStrategy
- All Known Implementing Classes:
BaseResourceAwareStrategy,ConstraintSolverStrategy,DefaultResourceAwareStrategy,DefaultResourceAwareStrategyOld,GenericResourceAwareStrategy,GenericResourceAwareStrategyOld,RoundRobinResourceAwareStrategy
public interface IStrategy
An interface to for implementing different scheduling strategies for the resource aware scheduling.
Scheduler should call
prepare(Map) followed by schedule(Cluster, TopologyDetails).
A fully functioning implementation is in the abstract class BaseResourceAwareStrategy.
Subclasses classes should extend BaseResourceAwareStrategy()
in their constructors (as in GenericResourceAwareStrategy, DefaultResourceAwareStrategy
and ConstraintSolverStrategy).
-
Method Summary
Modifier and TypeMethodDescriptionvoidPrepare the Strategy for scheduling.schedule(Cluster schedulingState, TopologyDetails td) This method is invoked to calculate a scheduling for topology td.
-
Method Details
-
prepare
Prepare the Strategy for scheduling.- Parameters:
config- the cluster configuration
-
schedule
This method is invoked to calculate a scheduling for topology td. Cluster will reject any changes that are not for the given topology. Any changes made to the cluster will be committed if the scheduling is successful.NOTE: scheduling occurs as a runnable in an interruptable thread. Scheduling should consider being interrupted if long running.
- Parameters:
schedulingState- the current state of the clustertd- the topology to schedule for- Returns:
- returns a SchedulingResult object containing SchedulingStatus object to indicate whether scheduling is successful.
-