/** * @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(); }
/** {@inheritDoc} */ @Override public void touch() { context().evicts().touch(this); }
/** {@inheritDoc} */ @Override @Nullable public CacheDataRow read(GridCacheMapEntry entry) throws IgniteCheckedException { KeyCacheObject key = entry.key(); assert grp.isLocal() || entry.localPartition() != null : entry; return dataStore(entry.localPartition()).find(entry.context(), key); }
/** {@inheritDoc} */ @Override public boolean mvccInitialValue( GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer) throws IgniteCheckedException { return dataStore(entry.localPartition()).mvccInitialValue( entry.context(), entry.key(), val, ver, expireTime, mvccVer, newMvccVer); }
/** {@inheritDoc} */ @Override public boolean mvccUpdateRowWithPreloadInfo( GridCacheMapEntry entry, @Nullable CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte mvccTxState, byte newMvccTxState ) throws IgniteCheckedException { assert entry.lockedByCurrentThread(); return dataStore(entry.localPartition()).mvccUpdateRowWithPreloadInfo( entry.context(), entry.key(), val, ver, expireTime, mvccVer, newMvccVer, mvccTxState, newMvccTxState ); }
/** {@inheritDoc} */ @Nullable @Override public MvccUpdateResult mvccLock(GridCacheMapEntry entry, MvccSnapshot mvccSnapshot) throws IgniteCheckedException { if (entry.detached() || entry.isNear()) return null; assert entry.lockedByCurrentThread(); return dataStore(entry.localPartition()).mvccLock(entry.context(), entry.key(), mvccSnapshot); }
/** {@inheritDoc} */ @Override public boolean mvccInitialValueIfAbsent( GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte txState, byte newTxState) throws IgniteCheckedException { return dataStore(entry.localPartition()).mvccInitialValueIfAbsent( entry.context(), entry.key(), val, ver, expireTime, mvccVer, newMvccVer, txState, newTxState); }
/** {@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 MvccUpdateResult mvccRemove( GridCacheMapEntry entry, MvccSnapshot mvccSnapshot, boolean primary, boolean needHistory, boolean needOldVal, @Nullable CacheEntryPredicate filter, boolean retVal) throws IgniteCheckedException { if (entry.detached() || entry.isNear()) return null; assert entry.lockedByCurrentThread(); return dataStore(entry.localPartition()).mvccRemove(entry.context(), entry.key(), mvccSnapshot, filter, primary, needHistory, needOldVal, retVal); }
return dataStore(entry.localPartition()).mvccUpdate(entry.context(), entry.key(), val,
/** * @param invokeEntry Entry for {@link EntryProcessor}. * @return Entry processor return value. */ private IgniteBiTuple<Object, Exception> runEntryProcessor(CacheInvokeEntry<Object, Object> invokeEntry) { EntryProcessor<Object, Object, ?> entryProcessor = (EntryProcessor<Object, Object, ?>)writeObj; IgniteThread.onEntryProcessorEntered(true); try { Object computed = entryProcessor.process(invokeEntry, invokeArgs); if (invokeEntry.modified()) { GridCacheContext cctx = entry.context(); writeObj = cctx.toCacheObject(cctx.unwrapTemporary(invokeEntry.getValue())); } else writeObj = invokeEntry.valObj; if (computed != null) return new IgniteBiTuple<>(entry.cctx.unwrapTemporary(computed), null); return null; } catch (Exception e) { if (e instanceof UnregisteredClassException || e instanceof UnregisteredBinaryTypeException) throw (IgniteException)e; writeObj = invokeEntry.valObj; return new IgniteBiTuple<>(null, e); } finally { IgniteThread.onEntryProcessorLeft(); } }
GridCacheContext cctx = entry.context();
boolean transformed) throws IgniteCheckedException { GridCacheContext cctx = entry.context();
return false; GridCacheContext cctx = entry.context();
@Nullable IgniteBiTuple<Object, Exception> invokeRes) throws IgniteCheckedException { GridCacheContext cctx = entry.context();
return row; GridCacheContext cctx = entry.context();
boolean valid; GridCacheContext cctx = entry.context();
assert entry.isNear() || oldRow == null || oldRow.link() != 0 : oldRow; GridCacheContext cctx = entry.context();
boolean valid; GridCacheContext cctx = entry.context(); GridCacheVersion newVer = tx.writeVersion();
boolean valid; GridCacheContext cctx = entry.context(); GridCacheVersion newVer = tx.writeVersion();