@Nullable ReaderArguments readerArgs ) throws IgniteCheckedException, GridCacheEntryRemovedException { lockEntry(); checkObsolete(); addReaderIfNeed(readerArgs); GridCacheMvcc mvcc = mvccExtras(); return entryGetResult(this.val, ver, false); IgniteBiTuple<Long, Long> initTtlAndExpireTime = initialTtlAndExpireTime(loadExpiryPlc); ttl = ttlExtras(); expTime = expireTimeExtras(); storeValue(val, expTime, newVer); if (deletedUnlocked()) deletedUnlocked(false); update(val, expTime, ttl, newVer, true); return entryGetResult(val, newVer, false); assert !evictionDisabled() : this; return entryGetResult(this.val, ver, false);
GridCacheVersion ver0; lockEntry(); checkObsolete(); if (!valid(topVer)) return null; unswap(null, false); if (checkExpired()) { if (cctx.deferredDelete()) { deferred = true; rmv = markObsolete0(cctx.versions().next(this.ver), true, null); updateTtl(expiryPlc); unlockEntry(); onMarkedObsolete();
/** {@inheritDoc} */ @Override public void mvccRemoveAll(GridCacheMapEntry entry) throws IgniteCheckedException { if (entry.detached() || entry.isNear()) return; dataStore(entry.localPartition()).mvccRemoveAll(entry.context(), entry.key()); }
/** {@inheritDoc} */ @Override public boolean isNewLocked() throws GridCacheEntryRemovedException { lockEntry(); try { checkObsolete(); return isStartVersion(); } finally { unlockEntry(); } }
/** {@inheritDoc} */ @Override public CacheObject valueBytes() throws GridCacheEntryRemovedException { lockEntry(); try { checkObsolete(); return this.val; } finally { unlockEntry(); } }
/** * @param entry Cache entry to create wrapper for. */ private EntryWrapper(GridCacheMapEntry entry) { expireTime = entry.expireTimeUnlocked(); assert expireTime != 0; this.ctx = entry.context(); this.key = entry.key(); }
final boolean valid = valid(tx != null ? tx.topologyVersion() : topVer); lockListenerReadLock(); lockEntry(); checkObsolete(); if (isNear()) { assert dhtVer != null; boolean startVer = isStartVersion(); newVer = explicitVer != null ? explicitVer : tx == null ? nextVersion() : tx.writeVersion(); boolean internal = isInternal() || !context().userCache(); notifyContinuousQueries() ? cctx.continuousQueries().updateListeners(internal, false) : null; unswap(); intercept = !skipInterceptor(explicitVer); removeValue(); update(null, 0, 0, newVer, true); if (cctx.deferredDelete() && !detached() && !isInternal()) { if (!deletedUnlocked()) {
lockEntry(); checkObsolete(); boolean valid = valid(tx != null ? tx.topologyVersion() : cctx.affinity().affinityTopologyVersion()); if (isStartVersion()) { unswap(null, false); long expireTime = expireTimeExtras(); if (onExpired((CacheObject)cctx.unwrapTemporary(val), null)) { val = null; evt = false; GridCacheMvcc mvcc = mvccExtras(); partition(), key, tx, updateTtl(expiryPlc); resVer = (isNear() && cctx.transactional()) ? ((GridNearCacheEntry)this).dhtVersion() : this.ver; addReaderIfNeed(readerArgs); res = retVer ? entryGetResult(ret, resVer, false) : ret;
final boolean valid = valid(tx != null ? tx.topologyVersion() : topVer); ensureFreeSpace(); lockListenerReadLock(); lockEntry(); checkObsolete(); if (isNear()) { assert dhtVer != null; boolean startVer = isStartVersion(); boolean internal = isInternal() || !context().userCache(); notifyContinuousQueries() ? cctx.continuousQueries().updateListeners(internal, false) : null; unswap(retval); nextVersion() : tx.writeVersion(); intercept = !skipInterceptor(explicitVer); ttl = ttlExtras(); expireTime = expireTimeExtras(); storeValue(val, expireTime, newVer);
lockListenerReadLock(); lockEntry(); checkObsolete(); boolean internal = isInternal() || !context().userCache(); if (isNew()) unswap(null, false); if (expireTimeExtras() > 0 && expireTimeExtras() < U.currentTimeMillis()) { if (onExpired(val, null)) { assert !deletedUnlocked(); update(null, CU.TTL_ETERNAL, CU.EXPIRE_TIME_ETERNAL, ver, true); old0 = readThrough(null, key, false, subjId, taskName); storeValue(old, expireTime, ver); else removeValue(); update(old, expireTime, ttl, ver, true); if (expiryPlc != null && !readFromStore && !cctx.putIfAbsentFilter(filter) && hasValueUnlocked()) updateTtl(expiryPlc); CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry<>(key, old, version(), keepBinary, this);
GridCacheContext cctx = entry.context(); GridCacheVersion newVer = tx.writeVersion(); entry.lockEntry(); if (entry.obsoleteVersionExtras() == null) break; entry.unlockEntry(); entry = (GridCacheMapEntry)cctx.cache().entryEx(entry.key()); valid = entry.valid(tx.topologyVersion()); boolean needOldVal = cctx.shared().mvccCaching().continuousQueryListeners(cctx, tx, entry.key()) != null; entry.unlockEntry(); if (cctx.deferredDelete() && entry.deletedUnlocked() && !entry.detached()) entry.deletedUnlocked(false); counters.decrementUpdateCounter(cctx.cacheId(), entry.partition()); counters.incrementUpdateCounter(cctx.cacheId(), entry.partition()); counters.accumulateSizeDelta(cctx.cacheId(), entry.partition(), -1); entry.logMvccUpdate(tx, null, 0, 0, mvccVer);
boolean fromStore ) throws IgniteCheckedException, GridCacheEntryRemovedException { ensureFreeSpace(); lockListenerReadLock(); lockEntry(); checkObsolete(); long oldExpTime = expireTimeUnlocked(); if (onExpired(this.val, null)) { if (cctx.deferredDelete()) { deferred = true; storeValue(val, expTime, ver); unswap(false); long oldExpTime = expireTimeUnlocked(); long delta = (oldExpTime == 0 ? 0 : oldExpTime - U.currentTimeMillis()); if (onExpired(this.val, null)) { if (cctx.deferredDelete()) { deferred = true; update = storeValue(val, expTime, ver, p); update(val, expTime, ttl, ver, true);
return row; GridCacheContext cctx = entry.context(); if (cctx.deferredDelete() && !entry.detached() && !entry.isInternal()) { entry.update(null, CU.TTL_ETERNAL, CU.EXPIRE_TIME_ETERNAL, entry.ver, true); if (!entry.deletedUnlocked() && !entry.isStartVersion()) entry.deletedUnlocked(true); entry.markObsolete0(cctx.versions().next(), true, null); cctx.events().addEvent(entry.partition(), entry.key(), cctx.localNodeId(), null, cctx.continuousQueries().onEntryExpired(entry, entry.key(), expiredVal);
lockEntry(); checkObsolete(); wasNew = isNew(); unlockEntry(); CacheObject ret = cctx.toCacheObject(readThrough(null, key, true, cctx.localNodeId(), taskName)); ensureFreeSpace(); lockEntry(); long ttl = ttlExtras(); if (wasNew && !isNew()) storeValue(ret, expTime, nextVer); if (cctx.deferredDelete() && !isInternal() && !detached() && deletedUnlocked()) deletedUnlocked(false); cctx.offheap().mvccRemoveAll(this); else removeValue(); if (cctx.deferredDelete() && !isInternal() && !detached() && !deletedUnlocked()) deletedUnlocked(true);
final boolean valid = valid(tx.topologyVersion()); ensureFreeSpace(); lockEntry(); checkObsolete(); ttl = ttlExtras(); expireTime = expireTimeExtras(); throw serializationError(); else if (res.resultType() == ResultType.FILTERED) { GridCacheUpdateTxResult updRes = new GridCacheUpdateTxResult(invoke); return new GridCacheUpdateTxResult(false); else if (res.resultType() == ResultType.LOCKED) { unlockEntry(); if (cctx.deferredDelete() && deletedUnlocked() && !detached()) deletedUnlocked(false); counters.incrementUpdateCounter(cctx.cacheId(), partition()); counters.incrementUpdateCounter(cctx.cacheId(), partition()); counters.accumulateSizeDelta(cctx.cacheId(), partition(), 1); counters.incrementUpdateCounter(cctx.cacheId(), partition());
/** {@inheritDoc} */ @Override public boolean hasLockCandidate(GridCacheVersion ver) throws GridCacheEntryRemovedException { lockEntry(); try { checkObsolete(); GridCacheMvcc mvcc = mvccExtras(); return mvcc != null && mvcc.hasCandidate(ver); } finally { unlockEntry(); } }
removeEntry(cached); if (!cached.isInternal()) { if (evt) { grp.addCacheEvent(cached.partition(), cached.key(), ctx.localNodeId(), EVT_CACHE_REBALANCE_OBJECT_UNLOADED, null, false, cached.rawGet(), cached.hasValue(), false); log.debug("Failed to clear cache entry for evicted partition: " + cached.partition());
final boolean valid = valid(tx.topologyVersion()); lockEntry(); checkObsolete(); throw serializationError(); else if (res.resultType() == ResultType.PREV_NULL) return new GridCacheUpdateTxResult(false); unlockEntry(); if (cctx.deferredDelete() && deletedUnlocked() && !detached()) deletedUnlocked(false); counters.decrementUpdateCounter(cctx.cacheId(), partition()); counters.incrementUpdateCounter(cctx.cacheId(), partition()); counters.accumulateSizeDelta(cctx.cacheId(), partition(), -1); logPtr = logMvccUpdate(tx, null, 0, 0L, mvccVer); update(null, 0, 0, newVer, true); recordNodeId(affNodeId, topVer); if (lockedByCurrentThread()) { unlockEntry();
boolean transformed) throws IgniteCheckedException { GridCacheContext cctx = entry.context(); newTtl = entry.ttlExtras(); newExpireTime = entry.expireTimeExtras(); boolean new0 = entry.isStartVersion(); assert entry.deletedUnlocked() || new0 || entry.isInternal() : "Invalid entry [entry=" + entry + ", locNodeId=" + cctx.localNodeId() + ']'; if (!new0 && !entry.isInternal()) entry.deletedUnlocked(false); assert !entry.deletedUnlocked() : "Invalid entry [entry=" + this + ", locNodeId=" + cctx.localNodeId() + ']'; long updateCntr0 = entry.nextPartitionCounter(topVer, primary, updateCntr); entry.logUpdate(op, updated, newVer, newExpireTime, updateCntr0); if (!entry.isNear()) { newRow = entry.localPartition().dataStore().createRow( entry.cctx, entry.key, entry.update(updated, newExpireTime, newTtl, newVer, true);
lockEntry(); if (obsolete()) return false; if ((!hasReaders() || readers)) { if (!(markObsolete0(ver, true, null))) { if (log.isDebugEnabled()) log.debug("Entry could not be marked obsolete (it is still used): " + this); clearReaders(); cctx.offheap().mvccRemoveAll(this); else removeValue(); unlockEntry(); onMarkedObsolete();