use of org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationAllocation in project hadoop by apache.
the class TestReservationSystemWithRMHA method validateReservation.
private void validateReservation(Plan plan, ReservationId resId, ReservationDefinition rDef) {
ReservationAllocation reservation = plan.getReservationById(resId);
Assert.assertNotNull(reservation);
Assert.assertEquals(rDef.getDeadline(), reservation.getReservationDefinition().getDeadline());
}
use of org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationAllocation in project hadoop by apache.
the class IterativePlanner method initialize.
protected void initialize(Plan plan, ReservationId reservationId, ReservationDefinition reservation) throws PlanningException {
// Get plan step & capacity
capacity = plan.getTotalCapacity();
step = plan.getStep();
// Get job parameters (type, arrival time & deadline)
jobType = reservation.getReservationRequests().getInterpreter();
jobArrival = stepRoundUp(reservation.getArrival(), step);
jobDeadline = stepRoundDown(reservation.getDeadline(), step);
// Initialize the plan modifications
planModifications = new RLESparseResourceAllocation(plan.getResourceCalculator());
// well with huge reservation ranges
if (this.algStageAllocator instanceof StageAllocatorLowCostAligned) {
planLoads = getAllLoadsInInterval(plan, jobArrival, jobDeadline);
ReservationAllocation oldRes = plan.getReservationById(reservationId);
if (oldRes != null) {
planModifications = RLESparseResourceAllocation.merge(plan.getResourceCalculator(), plan.getTotalCapacity(), planModifications, oldRes.getResourcesOverTime(), RLEOperator.subtract, jobArrival, jobDeadline);
}
}
}
Aggregations