...
Code Block | ||||
---|---|---|---|---|
| ||||
public static final class RackAwareOptimizationParams { private final ApplicationState applicationState; private final Optional<Integer> trafficCostOverride; private final Optional<Integer> nonOverlapCostOverride; private final Optional<SortedSet<TaskId>> tasksToOptimize; /** * Return a new config object with no overrides and the tasksToOptimize initialized to the set of all tasks in the given ApplicationState */ public static RackAwareOptimizationParams of(final ApplicationState applicationState); /** * Return a new config object with the tasksToOptimize set to all stateful tasks in the given ApplicationState */ public RackAwareOptimizationParams forStatefulTasks(); /** * Return a new config object with the tasksToOptimize set to all stateless tasks in the given ApplicationState */ public RackAwareOptimizationParams forStatelessTasks(); /** * Return a new config object with the provided tasksToOptimize */ public RackAwareOptimizationParams forTasks(final SortedSet<TaskId> tasksToOptimize); /** * Return a new config object with the provided trafficCost override applied */ public RackAwareOptimizationParams withTrafficCostOverride(final int trafficCostOverride); /** * Return a new config object with the provided nonOverlapCost override applied */ public RackAwareOptimizationParams withNonOverlapCostOverride(final int nonOverlapCostOverride); } |
AssignmentConfigs
Last, we have the AssignmentConfigs, which are (and would remain) just a basic container class, although we will migrate from public fields to standard getters for each of the configs passed into the assignor. Going forward, when a KIP is proposed to introduce a new config intended for the assignor, it should include the appropriate getter(s) in this class as part of the accepted proposal.
...