@Override public String toString() { StringBuilder result = new StringBuilder(); result.append("Size:").append(getSize()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ int max = 2000; for (CacheKey e : evictionQueue.keySet()) { result.append("(").append(e.getOrderingValue()).append(", ") //$NON-NLS-1$ //$NON-NLS-2$ .append(e.getLastAccess()).append(", ").append(e.getId()) //$NON-NLS-1$ .append(") "); //$NON-NLS-1$ if (--max == 0) { result.append("..."); //$NON-NLS-1$ } } return result.toString(); }
@Override public String toString() { StringBuilder result = new StringBuilder(); result.append("Size:").append(getSize()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ int max = 2000; for (CacheKey e : evictionQueue.keySet()) { result.append("(").append(e.getOrderingValue()).append(", ") //$NON-NLS-1$ //$NON-NLS-2$ .append(e.getLastAccess()).append(", ").append(e.getId()) //$NON-NLS-1$ .append(") "); //$NON-NLS-1$ if (--max == 0) { result.append("..."); //$NON-NLS-1$ } } return result.toString(); }
@Override public String toString() { StringBuilder result = new StringBuilder(); result.append("Size:").append(getSize()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ int max = 2000; for (CacheKey e : evictionQueue.keySet()) { result.append("(").append(e.getOrderingValue()).append(", ") //$NON-NLS-1$ //$NON-NLS-2$ .append(e.getLastAccess()).append(", ").append(e.getId()) //$NON-NLS-1$ .append(") "); //$NON-NLS-1$ if (--max == 0) { result.append("..."); //$NON-NLS-1$ } } return result.toString(); }
/** * Determine if an object should be in the memory buffer. * Adds are indicated by a current time of 0. * @param currentTime * @param info * @return */ private boolean shouldPlaceInMemoryBuffer(long currentTime, PhysicalInfo info) { PhysicalInfo lowest = memoryBufferEntries.firstEntry(false); CacheKey key = info.getKey(); return (blocksInuse.getTotalBits() - blocksInuse.getBitsSet()) > (cleaningThreshold + info.memoryBlockCount) || (lowest != null && lowest.block != EMPTY_ADDRESS && lowest.getKey().getOrderingValue() < (currentTime>0?memoryBufferEntries.computeNextOrderingValue(currentTime, key.getLastAccess(), key.getOrderingValue()):key.getOrderingValue())); }
/** * Determine if an object should be in the memory buffer. * @param currentTime * @param info * @return */ private boolean shouldPlaceInMemoryBuffer(PhysicalInfo info) { if (info.evicting || info.inode != EMPTY_ADDRESS) { return false; } if (info.block == EMPTY_ADDRESS) { return true; } PhysicalInfo lowest = memoryBufferEntries.firstEntry(false); CacheKey key = info.getKey(); return (blocksInuse.getTotalBits() - blocksInuse.getBitsSet()) > (cleaningThreshold + info.memoryBlockCount) || (lowest != null && lowest.block != EMPTY_ADDRESS && lowest.getKey().getOrderingValue() < key.getOrderingValue()); }
/** * Determine if an object should be in the memory buffer. * @param currentTime * @param info * @return */ private boolean shouldPlaceInMemoryBuffer(PhysicalInfo info) { if (info.evicting || info.inode != EMPTY_ADDRESS) { return false; } if (info.block == EMPTY_ADDRESS) { return true; } PhysicalInfo lowest = memoryBufferEntries.firstEntry(false); CacheKey key = info.getKey(); return (blocksInuse.getTotalBits() - blocksInuse.getBitsSet()) > (cleaningThreshold + info.memoryBlockCount) || (lowest != null && lowest.block != EMPTY_ADDRESS && lowest.getKey().getOrderingValue() < key.getOrderingValue()); }
/** * Callers should be synchronized on value */ void recordAccess(V value) { CacheKey key = value.getKey(); long lastAccess = key.getLastAccess(); long currentClock = clock.get(); long orderingValue = key.getOrderingValue(); orderingValue = computeNextOrderingValue(currentClock, lastAccess, orderingValue); assert !this.evictionQueue.containsKey(value.getKey()); value.setKey(new CacheKey(key.getId(), currentClock, orderingValue)); }
/** * Callers should be synchronized on value */ void recordAccess(V value) { CacheKey key = value.getKey(); long lastAccess = key.getLastAccess(); long currentClock = clock.get(); long orderingValue = key.getOrderingValue(); orderingValue = computeNextOrderingValue(currentClock, lastAccess, orderingValue); assert !this.evictionQueue.containsKey(value.getKey()); value.setKey(new CacheKey(key.getId(), currentClock, orderingValue)); }
/** * Callers should be synchronized on value */ void recordAccess(V value) { CacheKey key = value.getKey(); long lastAccess = key.getLastAccess(); long currentClock = clock.get(); long orderingValue = key.getOrderingValue(); orderingValue = computeNextOrderingValue(currentClock, lastAccess, orderingValue); assert !this.evictionQueue.containsKey(value.getKey()); value.setKey(new CacheKey(key.getId(), currentClock, orderingValue)); }
rowsSampled += batch.size(); Long oid = batchAdded.getAndIncrement(); CacheKey key = new CacheKey(oid, readAttempts.get(), old!=null?old.getKey().getOrderingValue():0); CacheEntry ce = new CacheEntry(key, sizeEstimate, batch, this.ref, false); if (!cache.addToCacheGroup(id, ce.getId())) {
rowsSampled += batch.size(); Long oid = batchAdded.getAndIncrement(); CacheKey key = new CacheKey(oid, readAttempts.get(), old!=null?old.getKey().getOrderingValue():0); CacheEntry ce = new CacheEntry(key, sizeEstimate, batch, this.ref, false); if (!cache.addToCacheGroup(id, ce.getId())) {
rowsSampled += batch.size(); Long oid = batchAdded.getAndIncrement(); CacheKey key = new CacheKey(oid, readAttempts.get(), old!=null?old.getKey().getOrderingValue():0); CacheEntry ce = new CacheEntry(key, sizeEstimate, batch, this.ref, false); if (!cache.addToCacheGroup(id, ce.getId())) {