fix aurora to use maximum resources to start containers (#1850)
* use scheduled resource to start aurora job
diff --git a/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java b/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
index 569be96..48f1367 100644
--- a/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
+++ b/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
@@ -92,13 +92,16 @@
LOG.info("Launching topology in aurora");
- // Align the cpu, ram, disk to the maximal one
+ // Align the cpu, ram, disk to the maximal one, and set them to ScheduledResource
PackingPlan updatedPackingPlan = packing.cloneWithHomogeneousScheduledResource();
SchedulerUtils.persistUpdatedPackingPlan(Runtime.topologyName(runtime), updatedPackingPlan,
Runtime.schedulerStateManagerAdaptor(runtime));
+ // Use the ScheduledResource to create aurora properties
+ // the ScheduledResource is guaranteed to be set after calling
+ // cloneWithHomogeneousScheduledResource in the above code
Resource containerResource =
- updatedPackingPlan.getContainers().iterator().next().getRequiredResource();
+ updatedPackingPlan.getContainers().iterator().next().getScheduledResource().get();
Map<AuroraField, String> auroraProperties = createAuroraProperties(containerResource);
return controller.createJob(auroraProperties);