private void validatePackingPlan ( PackingPlan plan ) throws PackingException { for ( PackingPlan . ContainerPlan containerPlan : plan . getContainers ( ) ) { for ( PackingPlan . InstancePlan instancePlan : containerPlan . getInstances ( ) ) { // Safe check if ( instancePlan . getResource ( ) . getRam ( ) . lessThan ( MIN_RAM_PER_INSTANCE ) ) { throw new PackingException ( String . format ( "Invalid packing plan generated. A minimum of " + "%s RAM is required, but InstancePlan for component '%s' has %s" , MIN_RAM_PER_INSTANCE , instancePlan . getComponentName ( ) , instancePlan . getResource ( ) . getRam ( ) ) ) ; } } } }
Check whether the PackingPlan generated is valid