Package org.apache.storm.scheduler.resource.strategies.scheduling

# 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 Type
  Method
  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.

- ## Method Details

  - ### prepare

    void prepare(Map<String,Object> config)
    Prepare the Strategy for scheduling.
    Parameters:
      `config` - the cluster configuration

  - ### schedule

    SchedulingResult 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.

    Parameters:
      `schedulingState` - the current state of the cluster
      `td` - the topology to schedule for
    Returns:
      returns a SchedulingResult object containing SchedulingStatus object to indicate whether scheduling is successful.