protected void init() { // we want params validation here if (currentSize.get() > 0) { if (!isOver.get()) { if (workspaceConfiguration.getPolicyAllocation() == AllocationPolicy.OVERALLOCATE && workspaceConfiguration.getOverallocationLimit() > 0) { currentSize.addAndGet((long) (currentSize.get() * workspaceConfiguration.getOverallocationLimit())); isOver.set(true); } } if (workspaceConfiguration.getMaxSize() > 0 && currentSize.get() > workspaceConfiguration.getMaxSize()) currentSize.set(workspaceConfiguration.getMaxSize()); } }
&& (workspaceConfiguration.getMaxSize() == 0 || (maxCycle.get() < workspaceConfiguration.getMaxSize()))) { if (workspaceConfiguration.getPolicyReset() != ResetPolicy.ENDOFBUFFER_REACHED) { destroyWorkspace(true); if (workspaceConfiguration.getMaxSize() > 0) currentSize.set(Math.min(maxCycle.get(), workspaceConfiguration.getMaxSize())); else currentSize.set(maxCycle.get());
protected void init() { // we want params validation here if (currentSize.get() > 0) { if (!isOver.get()) { if (workspaceConfiguration.getPolicyAllocation() == AllocationPolicy.OVERALLOCATE && workspaceConfiguration.getOverallocationLimit() > 0) { currentSize.addAndGet((long) (currentSize.get() * workspaceConfiguration.getOverallocationLimit())); isOver.set(true); } } if (workspaceConfiguration.getMaxSize() > 0 && currentSize.get() > workspaceConfiguration.getMaxSize()) currentSize.set(workspaceConfiguration.getMaxSize()); } }
@Override public void initializeWorkspace() { if ((currentSize.get() < maxCycle.get() || currentSize.get() < cycleAllocations.get()) && workspaceConfiguration.getPolicySpill() == SpillPolicy.REALLOCATE && (workspaceConfiguration.getMaxSize() == 0 || (maxCycle.get() < workspaceConfiguration.getMaxSize()))) { if (workspaceConfiguration.getPolicyReset() != ResetPolicy.ENDOFBUFFER_REACHED) { destroyWorkspace(true); if (workspaceConfiguration.getMaxSize() > 0) currentSize.set(Math.min(maxCycle.get(), workspaceConfiguration.getMaxSize())); else currentSize.set(maxCycle.get());