public interface IStrategy
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)
config
- the cluster configurationSchedulingResult schedule(Cluster schedulingState, TopologyDetails td)
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 © 2023 The Apache Software Foundation. All rights reserved.