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.BaseResourceAwareStrategy()
in their constructors (as in GenericResourceAwareStrategy
, DefaultResourceAwareStrategy
and ConstraintSolverStrategy
).
Modifier and Type | Method and Description |
---|---|
void |
prepare(Map<String,Object> config)
Prepare the Strategy for scheduling.
|
SchedulingResult |
schedule(Cluster schedulingState,
TopologyDetails td)
This method is invoked to calculate a scheduling for topology td.
|
void prepare(Map<String,Object> config)
Prepare the Strategy for scheduling.
config
- the cluster configurationSchedulingResult schedule(Cluster schedulingState, TopologyDetails td)
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.
schedulingState
- the current state of the clustertd
- the topology to schedule forCopyright © 2022 The Apache Software Foundation. All rights reserved.