public long getEarliestStartTime() { readLock.lock(); try { return rleSparseVector.getEarliestStartTime(); } finally { readLock.unlock(); } }
public long getEarliestStartTime() { readLock.lock(); try { return rleSparseVector.getEarliestStartTime(); } finally { readLock.unlock(); } }
public long getEarliestStartTime() { readLock.lock(); try { return rleSparseVector.getEarliestStartTime(); } finally { readLock.unlock(); } }
protected static boolean validateOrderNoGap( RLESparseResourceAllocation allocations, Map<ReservationInterval, Resource> curAlloc, boolean allocateLeft) { // Left to right if (allocateLeft) { Long stageStartTime = findEarliestTime(curAlloc); Long allocationEndTime = allocations.getLatestNonNullTime(); // Check that there is no gap between stages if ((allocationEndTime != -1) && (allocationEndTime < stageStartTime)) { return false; } // Right to left } else { Long stageEndTime = findLatestTime(curAlloc); Long allocationStartTime = allocations.getEarliestStartTime(); // Check that there is no gap between stages if ((allocationStartTime != -1) && (stageEndTime < allocationStartTime)) { return false; } } // Check that the stage allocation does not violate ORDER_NO_GAP if (!isNonPreemptiveAllocation(curAlloc)) { return false; } // The allocation is legal return true; }
Long allocationStartTime = allocations.getEarliestStartTime(); if (allocationStartTime != -1) { stageDeadline = allocationStartTime;
@Test public void testRangeOverlapping() { ResourceCalculator resCalc = new DefaultResourceCalculator(); RLESparseResourceAllocation r = new RLESparseResourceAllocation(resCalc); int[] alloc = { 10, 10, 10, 10, 10, 10 }; int start = 100; Set<Entry<ReservationInterval, Resource>> inputs = generateAllocation(start, alloc, false).entrySet(); for (Entry<ReservationInterval, Resource> ip : inputs) { r.addInterval(ip.getKey(), ip.getValue()); } long s = r.getEarliestStartTime(); long d = r.getLatestNonNullTime(); // tries to trigger "out-of-range" bug r = r.getRangeOverlapping(s, d); r = r.getRangeOverlapping(s - 1, d - 1); r = r.getRangeOverlapping(s + 1, d + 1); }
NavigableMap<Long, Resource> integralDown = new TreeMap<>(); long prevTime = toCheck.getEarliestStartTime(); IntegralResource prevResource = new IntegralResource(0L, 0L); IntegralResource runningTot = new IntegralResource(0L, 0L); tlimit.put(toCheck.getEarliestStartTime() - validWindow, maxAvgRes); RLESparseResourceAllocation targetLimit = new RLESparseResourceAllocation(tlimit, plan.getResourceCalculator());
long rstart = rle.getEarliestStartTime(); long rend = rle.getLatestNonNullTime();