private int computeNumAdditionalContainers(Map<String,Integer> componentChanges,PackingPlan packingPlan){
  Resource scaleDownResource=PackingUtils.computeTotalResourceChange(topology,componentChanges,defaultInstanceResources,PackingUtils.ScalingDirection.DOWN);
  Resource scaleUpResource=PackingUtils.computeTotalResourceChange(topology,componentChanges,defaultInstanceResources,PackingUtils.ScalingDirection.UP);
  Resource additionalResource=scaleUpResource.subtractAbsolute(scaleDownResource);
  return (int)additionalResource.divideBy(packingPlan.getMaxContainerResources());
}

private int computeNumAdditionalContainers ( Map < String , Integer > componentChanges , PackingPlan packingPlan ) { Resource scaleDownResource = PackingUtils . computeTotalResourceChange ( topology , componentChanges , defaultInstanceResources , PackingUtils . ScalingDirection . DOWN ) ; Resource scaleUpResource = PackingUtils . computeTotalResourceChange ( topology , componentChanges , defaultInstanceResources , PackingUtils . ScalingDirection . UP ) ; Resource additionalResource = scaleUpResource . subtractAbsolute ( scaleDownResource ) ; return ( int ) additionalResource . divideBy ( packingPlan . getMaxContainerResources ( ) ) ; }
computes the additional number of containers needed to accommodate a scale up / down operation
