boolean evict(CacheEntry ce) throws Exception { Serializer<?> s = ce.getSerializer(); if (s == null) { return true; } boolean persist = false; synchronized (ce) { if (!ce.isPersistent()) { persist = true; ce.setPersistent(true); } } if (persist) { long count = writeCount.incrementAndGet(); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, s.getId(), ce.getId(), "writing batch to storage, total writes: ", count); //$NON-NLS-1$ } } boolean result = cache.add(ce, s); if (s.useSoftCache()) { createSoftReference(ce); } else if (useWeakReferences) { weakReferenceCache.getValue(ce); //a get will set the value } return result; }
boolean evict(CacheEntry ce) throws Exception { Serializer<?> s = ce.getSerializer(); if (s == null) { return true; } boolean persist = false; synchronized (ce) { if (!ce.isPersistent()) { persist = true; ce.setPersistent(true); } } if (persist) { long count = writeCount.incrementAndGet(); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, s.getId(), ce.getId(), "writing batch to storage, total writes: ", count); //$NON-NLS-1$ } } boolean result = cache.add(ce, s); if (s.useSoftCache()) { createSoftReference(ce); } else if (useWeakReferences) { weakReferenceCache.getValue(ce); //a get will set the value } return result; }
boolean evict(CacheEntry ce) throws Exception { Serializer<?> s = ce.getSerializer(); if (s == null) { return true; } boolean persist = false; synchronized (ce) { if (!ce.isPersistent()) { persist = true; ce.setPersistent(true); } } if (persist) { long count = writeCount.incrementAndGet(); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, s.getId(), ce.getId(), "writing batch to storage, total writes: ", count); //$NON-NLS-1$ } } boolean result = cache.add(ce, s); if (s.useSoftCache()) { createSoftReference(ce); } else if (useWeakReferences) { weakReferenceCache.getValue(ce); //a get will set the value } return result; }