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

# Class ConstraintSolverConfig

java.lang.Object
org.apache.storm.scheduler.resource.strategies.scheduling.ConstraintSolverConfig

public final class ConstraintSolverConfig extends Object
Component constraint as derived from configuration. This is backward compatible and can parse old style Config.TOPOLOGY_RAS_CONSTRAINTS and Config.TOPOLOGY_SPREAD_COMPONENTS. New style Config.TOPOLOGY_RAS_CONSTRAINTS is map where each component has a list of other incompatible components and an optional number that specifies the maximum co-location count for the component on a node.

comp-1 cannot exist on same worker as comp-2 or comp-3, and at most "2" comp-1 on same node

comp-2 and comp-4 cannot be on same worker (missing comp-1 is implied from comp-1 constraint)

{ "comp-1": { "maxNodeCoLocationCnt": 2, "incompatibleComponents": ["comp-2", "comp-3" ] }, "comp-2": { "incompatibleComponents": [ "comp-4" ] } }

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONSTRAINT_TYPE_INCOMPATIBLE_COMPONENTS`
  `static final String`
  `CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConstraintSolverConfig(String topoId, Map<String,Object> topoConf, Set<String> comps)`
  `ConstraintSolverConfig(TopologyDetails topo)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,Set<String>>`
  `getIncompatibleComponentSets()`
  Return an object that maps component names to a set of other components which are incompatible and their executor instances cannot co-exist on the same worker.
  `Map<String,Integer>`
  `getMaxNodeCoLocationCnts()`
  Return an object that maps component names to a numeric maximum limit of executor instances (of that component) that can exist on any node.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT

    public static final String CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT
    See Also:
      - Constant Field Values

  - ### CONSTRAINT_TYPE_INCOMPATIBLE_COMPONENTS

    public static final String CONSTRAINT_TYPE_INCOMPATIBLE_COMPONENTS
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ConstraintSolverConfig

    public ConstraintSolverConfig(TopologyDetails topo)

  - ### ConstraintSolverConfig

    public ConstraintSolverConfig(String topoId, Map<String,Object> topoConf, Set<String> comps)

- ## Method Details

  - ### getIncompatibleComponentSets

    public Map<String,Set<String>> getIncompatibleComponentSets()
    Return an object that maps component names to a set of other components which are incompatible and their executor instances cannot co-exist on the same worker. The map will contain entries only for components that have this `CONSTRAINT_TYPE_INCOMPATIBLE_COMPONENTS` constraint specified.
    Returns:
      a map of component to a set of components that cannot co-exist on the same worker.

  - ### getMaxNodeCoLocationCnts

    public Map<String,Integer> getMaxNodeCoLocationCnts()
    Return an object that maps component names to a numeric maximum limit of executor instances (of that component) that can exist on any node. The map will contain entries only for components that have this `CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT` constraint specified.
    Returns:
      a map of component to its maximum limit of executor instances on a node.