Source:
<code>public void deleteProjectDirsIfNecessary(final long newProjectSizeInBytes) { final long cachePartitionSize = this.projectCacheDir.getTotalSpace(); final long availablePartitionSize = this.projectCacheDir.getUsableSpace(); final long start = System.currentTimeMillis(); loadAllProjects(); log.info("Loading project dirs metadata completed in msecs", cachedProjects.size(), System.currentTimeMillis() - start); <START> long currentCacheSize = getProjectDirsTotalSizeInBytes(); <END> long projectCacheDirCapacity = currentCacheSize + availablePartitionSize; boolean throttleAfterDeletion = false; final long highWatermark = (long) (projectCacheDirCapacity * this.percentageOfDisk); final long throttleWatermark = (long) (projectCacheDirCapacity * throttlePercentage); long projectedCacheSize = currentCacheSize + newProjectSizeInBytes; log.info("Partition = MB, Total Capacity = MB, Cache Size = MB, Projected Size = MB", bytesToMB(cachePartitionSize), bytesToMB(projectCacheDirCapacity), bytesToMB(currentCacheSize), bytesToMB(projectedCacheSize)); log.info("High Watermark = MB, Throttle Watermark = MB", bytesToMB(highWatermark), bytesToMB(throttleWatermark)); if (projectedCacheSize >= throttleWatermark) { throttleAfterDeletion = true; } if (projectedCacheSize >= highWatermark) { log.info("Projected cache size exceeds High Watermark. LRU Eviction will kick in"); deleteLeastRecentlyUsedProjects(projectedCacheSize - highWatermark); } if (throttleAfterDeletion) { log.info("Throttle Watermark was hit. Blocking till LRU eviction is complete."); finishPendingCleanup(); } }</code><technical_language>final, applies next line too</technical_language>

Target:
public void deleteProjectDirsIfNecessary(final long newProjectSizeInBytes) { final long cachePartitionSize = this.projectCacheDir.getTotalSpace(); final long availablePartitionSize = this.projectCacheDir.getUsableSpace(); final long start = System.currentTimeMillis(); loadAllProjects(); log.info("Loading project dirs metadata completed in msecs", cachedProjects.size(), System.currentTimeMillis() - start); final long currentCacheSize = getProjectDirsTotalSizeInBytes(); final long projectCacheDirCapacity = currentCacheSize + availablePartitionSize; boolean throttleAfterDeletion = false; final long highWatermark = (long) (projectCacheDirCapacity * this.percentageOfDisk); final long throttleWatermark = (long) (projectCacheDirCapacity * this.throttlePercentage); long projectedCacheSize = currentCacheSize + newProjectSizeInBytes; log.info("Partition = MB, Total Capacity = MB, Cache Size = MB, Projected Size = MB", bytesToMB(cachePartitionSize), bytesToMB(projectCacheDirCapacity), bytesToMB(currentCacheSize), bytesToMB(projectedCacheSize)); log.info("High Watermark = MB, Throttle Watermark = MB", bytesToMB(highWatermark), bytesToMB(throttleWatermark)); if (projectedCacheSize >= throttleWatermark) { throttleAfterDeletion = true; } if (projectedCacheSize >= highWatermark) { log.info("Projected cache size exceeds High Watermark. LRU Eviction will kick in"); deleteLeastRecentlyUsedProjects(projectedCacheSize - highWatermark); } if (throttleAfterDeletion) { log.info("Throttle Watermark was hit. Blocking till LRU eviction is complete."); finishPendingCleanup(); } }