private void removeInstancesFromContainers(ArrayList<Container> containers,Map<Integer,List<InstanceId>> allocation,Map<String,Integer> componentsToScaleDown){
  ArrayList<RamRequirement> ramRequirements=getRAMInstances(componentsToScaleDown);
  for (  RamRequirement ramRequirement : ramRequirements) {
    String component=ramRequirement.getComponentName();
    int numInstancesToRemove=-componentsToScaleDown.get(component);
    for (int j=0; j < numInstancesToRemove; j++) {
      Pair<Integer,InstanceId> idPair=removeRRInstance(containers,component);
      List<InstanceId> instances=allocation.get(idPair.first);
      instances.remove(idPair.second);
      allocation.put(idPair.first,instances);
    }
  }
}

private void removeInstancesFromContainers ( ArrayList < Container > containers , Map < Integer , List < InstanceId > > allocation , Map < String , Integer > componentsToScaleDown ) { ArrayList < RamRequirement > ramRequirements = getRAMInstances ( componentsToScaleDown ) ; for ( RamRequirement ramRequirement : ramRequirements ) { String component = ramRequirement . getComponentName ( ) ; int numInstancesToRemove = - componentsToScaleDown . get ( component ) ; for ( int j = 0 ; j < numInstancesToRemove ; j ++ ) { Pair < Integer , InstanceId > idPair = removeRRInstance ( containers , component ) ; List < InstanceId > instances = allocation . get ( idPair . first ) ; instances . remove ( idPair . second ) ; allocation . put ( idPair . first , instances ) ; } } }
removes instances from containers during scaling down
