IntegralResource prevResource = new IntegralResource(0L, 0L); IntegralResource runningTot = new IntegralResource(0L, 0L); prevResource.multiplyBy(currTime - prevTime); runningTot.add(prevResource); integralUp.put(currTime, normalizeToResource(runningTot, validWindow)); integralDown.put(currTime + validWindow,
IntegralResource runningTot = new IntegralResource(0L, 0L); IntegralResource maxAllowed = new IntegralResource(maxAvgRes); maxAllowed.multiplyBy(validWindow / step); runningTot.add(currExistingAllocForUser); runningTot.add(currNewAlloc); runningTot.subtract(currOldAlloc); runningTot.subtract(pastOldAlloc); runningTot.subtract(pastNewAlloc); if (maxAllowed.compareTo(runningTot) < 0) { throw new PlanningQuotaException( "Integral (avg over time) quota capacity " + maxAvg
IntegralResource runningTot = new IntegralResource(0L, 0L); IntegralResource maxAllowed = new IntegralResource(maxAvgRes); maxAllowed.multiplyBy(validWindow / step); runningTot.add(currExistingAllocForUser); runningTot.add(currNewAlloc); runningTot.subtract(currOldAlloc); runningTot.subtract(pastOldAlloc); runningTot.subtract(pastNewAlloc); if (maxAllowed.compareTo(runningTot) < 0) { throw new PlanningQuotaException( "Integral (avg over time) quota capacity " + maxAvg
public IntegralResource negate() { return new IntegralResource(-memory, -vcores); }