@Override public void doWithLockNoResult() { Context c = deallocateTimer.time(); try { if (assertDeallocated(instance.getId(), instance.getAllocationState(), "Instance")) { return; } releaseAllocation(instance); } finally { c.stop(); } } });
protected void allocateInstanceInternal(Instance origInstance, List<Instance> instances) { boolean origAllocated = assertAllocated(origInstance.getId(), origInstance.getAllocationState(), "Instance", true); for (Instance instance : instances) { boolean allocated = assertAllocated(origInstance.getId(), instance.getAllocationState(), "Instance", false); if (origAllocated ^ allocated) { throw new FailedToAllocate(String.format("Instance %s is in allocation state %s and instance %s is in allocation state %s.", origInstance.getId(), origInstance.getAllocationState(), instance.getId(), instance.getAllocationState()));
setRemoveTime(from.getRemoveTime()); setData(from.getData()); setAllocationState(from.getAllocationState()); setCompute(from.getCompute()); setMemoryMb(from.getMemoryMb());