BROOKLYN-212: AutoScaling doesn’t retry if InsufficientCapacity
authorAled Sage <aled.sage@gmail.com>
Fri, 8 Jan 2016 21:33:25 +0000 (21:33 +0000)
committerAled Sage <aled.sage@gmail.com>
Thu, 14 Jan 2016 10:45:13 +0000 (10:45 +0000)
commita91889d467848ceefa88855fd615afe9bca94931
treed635f4c2ab4391dfaa36317bc45c898b6f3849b3
parentdd3b8e823dd40d9bff2d7d5f7d31dc5b84291e9d
BROOKLYN-212: AutoScaling doesn’t retry if InsufficientCapacity

- Adds Resizable.InsufficientCapacityException, thrown by
  Resizable.resize() if could not grow at all.
- DynamicCluster catches NoMachinesAvailableException, and rethrows
  as InsufficientCapacityException in resize().
- AutoScalerPolicy catches InsufficientCapacityException, and sets
  insufficientCapacityHighWaterMark to record the max size it can get
  to. Does not try again to resize above that, unless the highWaterMark
  is explicitly cleared by reconfiguring that config value.
- Tests:
  - Changes TestCluster to include history of sizes and desiredSizes
  - Changes TestCluster, so can throw InsufficientCapacityException
    when gets to a particular size.
  - Test for DynamicCluster throwing InsufficientCapacityException
  - Test for AutoScalerPolicyMetricTest, to not resize above the failure
    level again.
  - Test for AutoScalerPolicyNoMoreMachinesTest, for when BYON location
    has run out of machines in a DynamicCluster.
brooklyn-server/core/src/main/java/org/apache/brooklyn/core/entity/trait/Resizable.java
brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
brooklyn-server/core/src/test/java/org/apache/brooklyn/core/entity/trait/FailingEntity.java
brooklyn-server/core/src/test/java/org/apache/brooklyn/core/entity/trait/FailingEntityImpl.java
brooklyn-server/core/src/test/java/org/apache/brooklyn/core/test/entity/TestCluster.java
brooklyn-server/core/src/test/java/org/apache/brooklyn/core/test/entity/TestClusterImpl.java
brooklyn-server/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
brooklyn-server/policy/src/main/java/org/apache/brooklyn/policy/autoscaling/AutoScalerPolicy.java
brooklyn-server/policy/src/test/java/org/apache/brooklyn/policy/autoscaling/AutoScalerPolicyMetricTest.java
brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/autoscaling/AutoScalerPolicyNoMoreMachinesTest.java [new file with mode: 0644]