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

## Class GenericResourceAwareSchedulingPriorityStrategy.GrasSimulatedUser

- java.lang.Object
- - org.apache.storm.scheduler.resource.strategies.priority.DefaultSchedulingPriorityStrategy.SimulatedUser
  - - org.apache.storm.scheduler.resource.strategies.priority.GenericResourceAwareSchedulingPriorityStrategy.GrasSimulatedUser

- Enclosing class:
    GenericResourceAwareSchedulingPriorityStrategy

      protected static class GenericResourceAwareSchedulingPriorityStrategy.GrasSimulatedUser
      extends DefaultSchedulingPriorityStrategy.SimulatedUser

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `Map<String,​Double>` | `guaranteedGenericResources` |

    - ### Fields inherited from class org.apache.storm.scheduler.resource.strategies.priority.DefaultSchedulingPriorityStrategy.SimulatedUser

      `assignedCpu, assignedMemory, guaranteedCpu, guaranteedMemory, tds`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GrasSimulatedUser​(User other, ISchedulingState cluster)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected double` | `getScore​(double availableCpu, double availableMemory, Map<String,​Double> availableGenericResources)` |
    `protected double` | `getScore​(double availableCpu, double availableMemory, Map<String,​Double> availableGenericResources, TopologyDetails td)` | Get a score for the simulated user.
    `TopologyDetails` | `simScheduleNextHighest()` |

    - ### Methods inherited from class org.apache.storm.scheduler.resource.strategies.priority.DefaultSchedulingPriorityStrategy.SimulatedUser

      `getNextHighest, getScore, getScore`

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

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

- - ### Field Detail

    - #### guaranteedGenericResources

          public final Map<String,​Double> guaranteedGenericResources

  - ### Constructor Detail

    - #### GrasSimulatedUser

          public GrasSimulatedUser​(User other,
                                   ISchedulingState cluster)

  - ### Method Detail

    - #### simScheduleNextHighest

          public TopologyDetails simScheduleNextHighest()

      Overrides:
        `simScheduleNextHighest` in class `DefaultSchedulingPriorityStrategy.SimulatedUser`

    - #### getScore

          protected double getScore​(double availableCpu,
                                    double availableMemory,
                                    Map<String,​Double> availableGenericResources,
                                    TopologyDetails td)

      Get a score for the simulated user. This is used to sort the users, by their highest priority topology. Only give user guarantees that will not exceed cluster capacity. Score of each resource type is calculated as: (Requested + Assigned - Guaranteed)/clusterAvailable The final score is a max over all resource types. Topology score will fall into the following intervals if: User is under quota (guarantee): [(-guarantee)/available : 0] User is over quota: (0, infinity) Unfortunately, score below 0 does not guarantee that the topology will be scheduled due to resources fragmentation.
      Parameters:
        `availableCpu` - available CPU on the cluster.
        `availableMemory` - available memory on the cluster.
        `availableGenericResources` - available generic resources (other that cpu and memory) in cluster
        `td` - the topology we are looking at.
      Returns:
        the score.

    - #### getScore

          protected double getScore​(double availableCpu,
                                    double availableMemory,
                                    Map<String,​Double> availableGenericResources)