Search in sources :

Example 6 with RamRequirement

use of com.twitter.heron.packing.RamRequirement in project incubator-heron by apache.

the class FirstFitDecreasingPacking method assignInstancesToContainers.

/**
 * Assigns instances to containers
 *
 * @param planBuilder existing packing plan
 * @param parallelismMap component parallelism
 */
private void assignInstancesToContainers(PackingPlanBuilder planBuilder, Map<String, Integer> parallelismMap) throws ResourceExceededException {
    ArrayList<RamRequirement> ramRequirements = getSortedRAMInstances(parallelismMap.keySet());
    for (RamRequirement ramRequirement : ramRequirements) {
        String componentName = ramRequirement.getComponentName();
        int numInstance = parallelismMap.get(componentName);
        for (int j = 0; j < numInstance; j++) {
            placeFFDInstance(planBuilder, componentName);
        }
    }
}
Also used : RamRequirement(com.twitter.heron.packing.RamRequirement)

Aggregations

RamRequirement (com.twitter.heron.packing.RamRequirement)6 ArrayList (java.util.ArrayList)4 ByteAmount (com.twitter.heron.common.basics.ByteAmount)2 ContainerIdScorer (com.twitter.heron.packing.builder.ContainerIdScorer)2 HomogeneityScorer (com.twitter.heron.packing.builder.HomogeneityScorer)2 InstanceCountScorer (com.twitter.heron.packing.builder.InstanceCountScorer)2 Scorer (com.twitter.heron.packing.builder.Scorer)2 Resource (com.twitter.heron.spi.packing.Resource)2