@Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }
validateInput(plan, currentReservationStage, totalCapacity); placeSingleStage(plan, tempAssigned, currentReservationStage, earliestStart, curDeadline, oldReservation, totalCapacity); curDeadline = findEarliestTime(curAlloc.keySet()); if (oldDeadline - findLatestTime(curAlloc.keySet()) > plan .getStep()) { throw new PlanningException("The GreedyAgent" ReservationRequest.newInstance(Resource.newInstance(0, 0), 0); long firstStartTime = findEarliestTime(allocations.keySet()); new InMemoryReservationAllocation(reservationId, contract, user, plan.getQueueName(), firstStartTime, findLatestTime(allocations.keySet()), allocations, plan.getResourceCalculator(), plan.getMinimumAllocation()); if (oldReservation != null) {
@Before public void setup() throws Exception { long seed = rand.nextLong(); rand.setSeed(seed); Log.info("Running with seed: " + seed); // setting completely loose quotas long timeWindow = 1000000L; Resource clusterCapacity = Resource.newInstance(100 * 1024, 100); step = 1000L; ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil(); String reservationQ = testUtil.getFullReservationQueueName(); float instConstraint = 100; float avgConstraint = 100; ReservationSchedulerConfiguration conf = ReservationSystemTestUtil.createConf(reservationQ, timeWindow, instConstraint, avgConstraint); CapacityOverTimePolicy policy = new CapacityOverTimePolicy(); policy.init(reservationQ, conf); agent = new GreedyReservationAgent(); QueueMetrics queueMetrics = mock(QueueMetrics.class); plan = new InMemoryPlan(queueMetrics, policy, agent, clusterCapacity, step, res, minAlloc, maxAlloc, "dedicated", null, true); }
validateInput(plan, currentReservationStage, totalCapacity); placeSingleStage(plan, tempAssigned, currentReservationStage, earliestStart, curDeadline, oldReservation, totalCapacity); curDeadline = findEarliestTime(curAlloc.keySet()); if (oldDeadline - findLatestTime(curAlloc.keySet()) > plan .getStep()) { throw new PlanningException("The GreedyAgent" ReservationRequest.newInstance(Resource.newInstance(0, 0), 0); long firstStartTime = findEarliestTime(allocations.keySet()); new InMemoryReservationAllocation(reservationId, contract, user, plan.getQueueName(), firstStartTime, findLatestTime(allocations.keySet()), allocations, plan.getResourceCalculator(), plan.getMinimumAllocation()); if (oldReservation != null) {
@Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }
@Override public boolean updateReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, plan.getReservationById(reservationId)); }
@Override public boolean updateReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, plan.getReservationById(reservationId)); }