/** * Perform any pre-allocation operations on the list of allocated containers * based on knowledge of system state. * Currently this places requested hosts ahead of unrequested ones. * @param allocatedContainers list of allocated containers * @return list of containers potentially reordered */ public synchronized List<Container> prepareAllocationList(List<Container> allocatedContainers) { //partition into requested and unrequested List<Container> requested = new ArrayList<>(allocatedContainers.size()); List<Container> unrequested = new ArrayList<>(allocatedContainers.size()); outstandingRequests.partitionRequests(this, allocatedContainers, requested, unrequested); //give the unrequested ones lower priority requested.addAll(unrequested); return requested; }
/** * Perform any pre-allocation operations on the list of allocated containers * based on knowledge of system state. * Currently this places requested hosts ahead of unrequested ones. * @param allocatedContainers list of allocated containers * @return list of containers potentially reordered */ public synchronized List<Container> prepareAllocationList(List<Container> allocatedContainers) { //partition into requested and unrequested List<Container> requested = new ArrayList<>(allocatedContainers.size()); List<Container> unrequested = new ArrayList<>(allocatedContainers.size()); outstandingRequests.partitionRequests(this, allocatedContainers, requested, unrequested); //give the unrequested ones lower priority requested.addAll(unrequested); return requested; }