/** * Attempt to reserve the given amount of memory with the cache Manager. * @param bytesNeeded * @return */ boolean reserveLockedMemory(long bytesNeeded) { if (cacheManager.reserve(bytesNeeded) > 0) { return true; } // Round up bytes needed to osPageSize and attempt to evict // one more more blocks to free up the reservation. bytesNeeded = cacheManager.roundUpPageSize(bytesNeeded); evictLazyPersistBlocks(bytesNeeded); return cacheManager.reserve(bytesNeeded) > 0; }
ExtendedBlock extBlk = new ExtendedBlock(key.getBlockPoolId(), key.getBlockId(), length, genstamp); long newUsedBytes = reserve(length); boolean reservedBytes = false; try {
if (vol.isTransientStorage()) { long lockedBytesReserved = cacheManager.reserve(diskBlockInfo.getNumBytes()) > 0 ? diskBlockInfo.getNumBytes() : 0; ramDiskReplicaTracker.addReplica(