From fbdfef05d4a2125923284edbe8be48f0923dbd30 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Mon, 29 Jul 2024 16:36:12 +0300 Subject: [PATCH] Revert "WIP" This reverts commit d3073f959cd9c866836745a83ae44f01dc73cc54. --- .../cache/GridCacheTestEntryEx.java | 759 ++++++------------ 1 file changed, 224 insertions(+), 535 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java index 7bb2758dc5fe4..3bfa07b269fe0 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal.processors.cache; import java.util.Collection; -import java.util.Collections; import java.util.UUID; import javax.cache.Cache; import org.apache.ignite.IgniteCheckedException; @@ -40,37 +39,28 @@ */ @SuppressWarnings("unchecked") public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements GridCacheEntryEx { + /** Context */ + private final GridCacheContext context; + /** Key. */ - private KeyCacheObject key; + private final KeyCacheObject key; /** Val. */ - private CacheObject val; - - /** TTL. */ - private long ttl; + private final CacheObject val; /** Version. */ - private GridCacheVersion ver = new GridCacheVersion(0, 0, 1, 0); - - /** Obsolete version. */ - private GridCacheVersion obsoleteVer = ver; + private final GridCacheVersion ver; - /** MVCC. */ - private GridCacheMvcc mvcc; - - /** - * @param ctx Context. - * @param key Key. - */ - GridCacheTestEntryEx(GridCacheContext ctx, Object key) { - mvcc = new GridCacheMvcc(ctx); - - this.key = ctx.toCacheKeyObject(key); - } + /** TTL. */ + private final long ttl; - /** {@inheritDoc} */ - @Override public int memorySize() throws IgniteCheckedException { - return 1024; + /** */ + public GridCacheTestEntryEx(GridCacheContext context, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long ttl) { + this.context = context; + this.key = key; + this.val = val; + this.ver = ver; + this.ttl = ttl; } /** {@inheritDoc} */ @@ -81,9 +71,21 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr return false; } + /** {@inheritDoc} */ + @Override public boolean initialValue(CacheObject val, GridCacheVersion ver, long ttl, long expireTime, boolean preload, + AffinityTopologyVersion topVer, GridDrType drType, boolean fromStore, boolean primary, @Nullable CacheDataRow row) + throws IgniteCheckedException, GridCacheEntryRemovedException { + return false; + } + + /** {@inheritDoc} */ + @Override public int memorySize() throws IgniteCheckedException { + return 0; + } + /** {@inheritDoc} */ @Override public boolean isInternal() { - return key instanceof GridCacheInternal; + return false; } /** {@inheritDoc} */ @@ -112,13 +114,13 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr } /** {@inheritDoc} */ - @Nullable @Override public GridCacheContext context() { - return null; + @Override public boolean deleted() { + return false; } /** {@inheritDoc} */ - @Nullable @Override public EvictableEntry wrapEviction() { - return null; + @Override public GridCacheContext context() { + return context; } /** {@inheritDoc} */ @@ -127,640 +129,360 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr } /** {@inheritDoc} */ - @Override public boolean partitionValid() { - return true; - } - - /** - * @param threadId Thread ID. - * @param ver Lock version. - * @param timeout Lock acquisition timeout. - * @param reenter Reentry flag ({@code true} if reentry is allowed). - * @param tx Transaction flag. - * @return New lock candidate if lock was added, or current owner if lock was reentered, - * or null if lock was owned by another thread and timeout is negative. - */ - @Nullable GridCacheMvccCandidate addLocal( - long threadId, - GridCacheVersion ver, - long timeout, - boolean reenter, - boolean tx) { - return mvcc.addLocal( - this, - threadId, - ver, - timeout, - reenter, - tx, - false, - false - ); - } - - /** - * Adds new lock candidate. - * - * @param nodeId Node ID. - * @param threadId Thread ID. - * @param ver Lock version. - * @param tx Transaction flag. - * @return Remote candidate. - */ - GridCacheMvccCandidate addRemote(UUID nodeId, long threadId, GridCacheVersion ver, - boolean tx) { - return mvcc.addRemote(this, nodeId, null, threadId, ver, tx, true, false); - } - - /** - * Adds new lock candidate. - * - * @param nodeId Node ID. - * @param threadId Thread ID. - * @param ver Lock version. - * @param tx Transaction flag. - * @return Remote candidate. - */ - GridCacheMvccCandidate addNearLocal(UUID nodeId, long threadId, GridCacheVersion ver, - boolean tx) { - return mvcc.addNearLocal(this, nodeId, null, threadId, ver, tx, true, false); - } - - /** - * - * @param baseVer Base version. - */ - void salvageRemote(GridCacheVersion baseVer) { - mvcc.salvageRemote(baseVer, false); - } - - /** - * Moves completed candidates right before the base one. Note that - * if base is not found, then nothing happens and {@code false} is - * returned. - * - * @param baseVer Base version. - * @param committedVers Committed versions relative to base. - * @param rolledbackVers Rolled back versions relative to base. - */ - void orderCompleted(GridCacheVersion baseVer, - Collection committedVers, Collection rolledbackVers) { - mvcc.orderCompleted(baseVer, committedVers, rolledbackVers); - } - - /** - * @param ver Version. - */ - void doneRemote(GridCacheVersion ver) { - mvcc.doneRemote(ver, Collections.emptyList(), - Collections.emptyList(), Collections.emptyList()); - } - - /** - * @param baseVer Base version. - * @param owned Owned. - */ - void orderOwned(GridCacheVersion baseVer, GridCacheVersion owned) { - mvcc.markOwned(baseVer, owned); - } - - /** - * @param ver Lock version to acquire or set to ready. - */ - void readyLocal(GridCacheVersion ver) { - mvcc.readyLocal(ver); - } - - /** - * @param ver Ready near lock version. - * @param mapped Mapped version. - * @param committedVers Committed versions. - * @param rolledbackVers Rolled back versions. - * @param pending Pending versions. - */ - void readyNearLocal(GridCacheVersion ver, GridCacheVersion mapped, - Collection committedVers, Collection rolledbackVers, - Collection pending) { - mvcc.readyNearLocal(ver, mapped, committedVers, rolledbackVers, pending); - } - - /** - * @param cand Candidate to set to ready. - */ - void readyLocal(GridCacheMvccCandidate cand) { - mvcc.readyLocal(cand); - } - - /** - * Local release. - * - * @param threadId ID of the thread. - */ - void releaseLocal(long threadId) { - mvcc.releaseLocal(threadId); - } - - /** - * - */ - void recheckLock() { - mvcc.recheck(); - } - - /** {@inheritDoc} */ - @Override public GridCacheEntryInfo info() { - GridCacheEntryInfo info = new GridCacheEntryInfo(); - - info.key(key()); - info.value(val); - info.ttl(ttl()); - info.expireTime(expireTime()); - info.version(version()); - - return info; - } - - /** {@inheritDoc} */ - @Override public boolean valid(AffinityTopologyVersion topVer) { - return true; - } - - /** @inheritDoc */ @Override public KeyCacheObject key() { return key; } /** {@inheritDoc} */ @Override public IgniteTxKey txKey() { - return new IgniteTxKey(key, 0); + return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public CacheObject rawGet() { return val; } /** {@inheritDoc} */ @Override public boolean hasValue() { - return val != null; + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public CacheObject rawPut(CacheObject val, long ttl) { - CacheObject old = this.val; - - this.ttl = ttl; - this.val = val; - - return old; + return null; } - /** @inheritDoc */ - @Override public Cache.Entry wrap() { - assert false; - + /** {@inheritDoc} */ + @Override public Cache.Entry wrap() { return null; } - /** @inheritDoc */ - @Override public Cache.Entry wrapLazyValue(boolean keepBinary) { - assert false; - + /** {@inheritDoc} */ + @Override public Cache.Entry wrapLazyValue(boolean keepBinary) { return null; } /** {@inheritDoc} */ - @Override public CacheEntryImplEx wrapVersioned() { - assert false; - + @Override public @Nullable CacheObject peekVisibleValue() { return null; } - /** @inheritDoc */ - @Nullable @Override public CacheObject peekVisibleValue() { - assert false; + /** {@inheritDoc} */ + @Override public EvictableEntry wrapEviction() { + return null; + } + /** {@inheritDoc} */ + @Override public CacheEntryImplEx wrapVersioned() { return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public GridCacheVersion obsoleteVersion() { - return obsoleteVer; + return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean obsolete() { - return obsoleteVer != null; + return false; + } + + /** {@inheritDoc} */ + @Override public boolean obsoleteOrDeleted() { + return false; } /** {@inheritDoc} */ @Override public boolean obsolete(GridCacheVersion exclude) { - return obsoleteVer != null && !obsoleteVer.equals(exclude); + return false; } - /** @inheritDoc */ - @Override public boolean invalidate(GridCacheVersion newVer) - throws IgniteCheckedException { - assert false; + /** {@inheritDoc} */ + @Override public @Nullable GridCacheEntryInfo info() { + return null; + } + /** {@inheritDoc} */ + @Override public boolean invalidate(GridCacheVersion newVer) throws IgniteCheckedException { return false; } - /** @inheritDoc */ - @Override public boolean evictInternal(GridCacheVersion obsoleteVer, - @Nullable CacheEntryPredicate[] filter, boolean evictOffheap) { - assert false; - + /** {@inheritDoc} */ + @Override public boolean evictInternal(GridCacheVersion obsoleteVer, @Nullable CacheEntryPredicate[] filter, + boolean evictOffheap) { return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ + @Override public void onMarkedObsolete() { + + } + + /** {@inheritDoc} */ @Override public boolean isNew() { - assert false; return false; + return false; } /** {@inheritDoc} */ - @Override public boolean isNewLocked() throws GridCacheEntryRemovedException { - assert false; return false; + @Override public boolean isNewLocked() { + return false; } - /** @inheritDoc */ - @Override public CacheObject innerGet( - @Nullable GridCacheVersion ver, - @Nullable IgniteInternalTx tx, - boolean readThrough, - boolean updateMetrics, - boolean evt, - Object transformClo, - String taskName, - @Nullable IgniteCacheExpiryPolicy expiryPlc, - boolean keepBinary) { - return val; + /** {@inheritDoc} */ + @Override public boolean valid(AffinityTopologyVersion topVer) { + return false; } - /** @inheritDoc */ - @Override public void clearReserveForLoad(GridCacheVersion ver) { - assert false; + /** {@inheritDoc} */ + @Override public boolean partitionValid() { + return false; } - /** @inheritDoc */ - @Override public EntryGetResult innerGetAndReserveForLoad( - boolean updateMetrics, - boolean evt, - String taskName, + /** {@inheritDoc} */ + @Override public CacheObject innerGet(@Nullable GridCacheVersion ver, @Nullable IgniteInternalTx tx, boolean readThrough, + boolean updateMetrics, boolean evt, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, - boolean keepBinary, - @Nullable ReaderArguments args) throws IgniteCheckedException, GridCacheEntryRemovedException { - assert false; - + boolean keepBinary) { return null; } - /** @inheritDoc */ - @Nullable @Override public EntryGetResult innerGetVersioned( - @Nullable GridCacheVersion ver, - IgniteInternalTx tx, - boolean updateMetrics, - boolean evt, - Object transformClo, - String taskName, - @Nullable IgniteCacheExpiryPolicy expiryPlc, + /** {@inheritDoc} */ + @Override public EntryGetResult innerGetVersioned(@Nullable GridCacheVersion ver, IgniteInternalTx tx, boolean updateMetrics, + boolean evt, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, @Nullable ReaderArguments readerArgs) { - assert false; - return null; } - /** @inheritDoc */ - @Override public CacheObject innerReload() { - return val; + /** {@inheritDoc} */ + @Override public EntryGetResult innerGetAndReserveForLoad(boolean updateMetrics, boolean evt, String taskName, + @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, + @Nullable ReaderArguments readerArgs) { + return null; } - /** @inheritDoc */ - @Override public GridCacheUpdateTxResult innerSet(@Nullable IgniteInternalTx tx, - UUID evtNodeId, - UUID affNodeId, - @Nullable CacheObject val, - boolean writeThrough, - boolean retval, - long ttl, - boolean evt, - boolean metrics, - boolean keepBinary, - boolean hasOldVal, - @Nullable CacheObject oldVal, - AffinityTopologyVersion topVer, - CacheEntryPredicate[] filter, - GridDrType drType, - long drExpireTime, - @Nullable GridCacheVersion drVer, - String taskName, - @Nullable GridCacheVersion dhtVer, - @Nullable Long updateCntr - ) throws IgniteCheckedException, GridCacheEntryRemovedException { - rawPut(val, ttl); - - return new GridCacheUpdateTxResult(true); - } - - /** {@inheritDoc} */ - @Override public GridCacheUpdateAtomicResult innerUpdate( - GridCacheVersion ver, - UUID evtNodeId, - UUID affNodeId, - GridCacheOperation op, - @Nullable Object val, - @Nullable Object[] invokeArgs, - boolean writeThrough, - boolean readThrough, - boolean retval, - boolean keepBinary, - @Nullable IgniteCacheExpiryPolicy expiryPlc, - boolean evt, - boolean metrics, - boolean primary, - boolean checkVer, - boolean readRepairRecovery, - AffinityTopologyVersion topVer, - @Nullable CacheEntryPredicate[] filter, - GridDrType drType, - long conflictTtl, - long conflictExpireTime, - @Nullable GridCacheVersion conflictVer, - boolean conflictResolve, - boolean intercept, - String taskName, - @Nullable CacheObject prevVal, - @Nullable Long updateCntr, - @Nullable GridDhtAtomicAbstractUpdateFuture fut, - boolean transformOp) - throws IgniteCheckedException, GridCacheEntryRemovedException { - assert false; + /** {@inheritDoc} */ + @Override public void clearReserveForLoad(GridCacheVersion ver) { + } + + /** {@inheritDoc} */ + @Override public @Nullable CacheObject innerReload() { return null; } - /** @inheritDoc */ - @Override public GridCacheUpdateTxResult innerRemove( - @Nullable IgniteInternalTx tx, - UUID evtNodeId, - UUID affNodeId, - boolean retval, - boolean evt, - boolean metrics, - boolean keepBinary, - boolean oldValPresent, - @Nullable CacheObject oldVal, - AffinityTopologyVersion topVer, - CacheEntryPredicate[] filter, - GridDrType drType, - @Nullable GridCacheVersion drVer, - String taskName, - @Nullable GridCacheVersion dhtVer, - @Nullable Long updateCntr - ) throws IgniteCheckedException, GridCacheEntryRemovedException { - obsoleteVer = ver; + /** {@inheritDoc} */ + @Override public GridCacheUpdateTxResult innerSet(@Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, + @Nullable CacheObject val, boolean writeThrough, boolean retval, long ttl, boolean evt, boolean metrics, + boolean keepBinary, boolean oldValPresent, @Nullable CacheObject oldVal, AffinityTopologyVersion topVer, + CacheEntryPredicate[] filter, GridDrType drType, long drExpireTime, @Nullable GridCacheVersion explicitVer, + String taskName, @Nullable GridCacheVersion dhtVer, + @Nullable Long updateCntr) { + return null; + } - val = null; + /** {@inheritDoc} */ + @Override public GridCacheUpdateTxResult innerRemove(@Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, + boolean retval, boolean evt, boolean metrics, boolean keepBinary, boolean oldValPresent, + @Nullable CacheObject oldVal, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, + @Nullable GridCacheVersion explicitVer, String taskName, @Nullable GridCacheVersion dhtVer, + @Nullable Long updateCntr) { + return null; + } - return new GridCacheUpdateTxResult(true); + /** {@inheritDoc} */ + @Override public GridCacheUpdateAtomicResult innerUpdate(GridCacheVersion ver, UUID evtNodeId, UUID affNodeId, + GridCacheOperation op, @Nullable Object val, @Nullable Object[] invokeArgs, boolean writeThrough, + boolean readThrough, boolean retval, boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean evt, boolean metrics, boolean primary, boolean checkVer, boolean readRepairRecovery, + AffinityTopologyVersion topVer, @Nullable CacheEntryPredicate[] filter, GridDrType drType, long conflictTtl, + long conflictExpireTime, @Nullable GridCacheVersion conflictVer, CacheObject prevStateMeta, + boolean conflictResolve, boolean intercept, String taskName, @Nullable CacheObject prevVal, + @Nullable Long updateCntr, @Nullable GridDhtAtomicAbstractUpdateFuture fut, + boolean transformOp) { + return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean clear(GridCacheVersion ver, boolean readers) throws IgniteCheckedException { - if (ver == null || ver.equals(this.ver)) { - val = null; - - return true; - } - return false; } - /** @inheritDoc */ - @Override public boolean tmLock(IgniteInternalTx tx, - long timeout, - @Nullable GridCacheVersion serOrder, - GridCacheVersion serReadVer, + /** {@inheritDoc} */ + @Override public boolean tmLock(IgniteInternalTx tx, long timeout, @Nullable GridCacheVersion serOrder, + @Nullable GridCacheVersion serReadVer, boolean read) { - assert false; return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public void txUnlock(IgniteInternalTx tx) { - assert false; - } - - /** @inheritDoc */ - @Override public boolean removeLock(GridCacheVersion ver) { - GridCacheMvccCandidate doomed = mvcc.candidate(ver); - - mvcc.remove(ver); - return doomed != null; } - /** @inheritDoc */ - @Override public boolean markObsolete(GridCacheVersion ver) { - if (ver == null || ver.equals(obsoleteVer)) { - obsoleteVer = ver; - - val = null; - - return true; - } - + /** {@inheritDoc} */ + @Override public boolean removeLock(GridCacheVersion ver) { return false; } /** {@inheritDoc} */ - @Override public void onMarkedObsolete() { - // No-op. + @Override public boolean markObsolete(GridCacheVersion ver) { + return false; } /** {@inheritDoc} */ - @Override public boolean markObsoleteIfEmpty(GridCacheVersion ver) { - if (val == null) - obsoleteVer = ver; - - return obsoleteVer != null; + @Override public boolean markObsoleteIfEmpty(@Nullable GridCacheVersion ver) { + return false; } /** {@inheritDoc} */ @Override public boolean markObsoleteVersion(GridCacheVersion ver) { - if (this.ver.equals(ver)) { - obsoleteVer = ver; - - return true; - } - return false; } - /** @inheritDoc */ - @Override public GridCacheVersion version() { + /** {@inheritDoc} */ + @Override public GridCacheVersion version() throws GridCacheEntryRemovedException { return ver; } - /** @inheritDoc */ - @Override public boolean checkSerializableReadVersion(GridCacheVersion ver) { - assert false; - + /** {@inheritDoc} */ + @Override public boolean checkSerializableReadVersion(GridCacheVersion serReadVer) { return false; } - /** @inheritDoc */ - @Override public boolean initialValue( - CacheObject val, - GridCacheVersion ver, - long ttl, - long expireTime, - boolean preload, - AffinityTopologyVersion topVer, - GridDrType drType, - boolean fromStore, - boolean primary, - CacheDataRow row - ) throws IgniteCheckedException, GridCacheEntryRemovedException { - assert false; + /** {@inheritDoc} */ + @Override public @Nullable CacheObject peek(boolean heap, boolean offheap, AffinityTopologyVersion topVer, + @Nullable IgniteCacheExpiryPolicy plc) throws GridCacheEntryRemovedException, IgniteCheckedException { + return null; + } - return false; + /** {@inheritDoc} */ + @Override public @Nullable CacheObject peek() throws GridCacheEntryRemovedException, IgniteCheckedException { + return null; } - /** @inheritDoc */ - @Override public GridCacheVersionedEntryEx versionedEntry(final boolean keepBinary) throws IgniteCheckedException { + /** {@inheritDoc} */ + @Override public GridCacheVersionedEntryEx versionedEntry(boolean keepBinary) { return null; } - /** @inheritDoc */ - @Override public EntryGetResult versionedValue(CacheObject val, - GridCacheVersion curVer, - GridCacheVersion newVer, - @Nullable IgniteCacheExpiryPolicy loadExpiryPlc, + /** {@inheritDoc} */ + @Override public EntryGetResult versionedValue(CacheObject val, @Nullable GridCacheVersion curVer, + @Nullable GridCacheVersion newVer, @Nullable IgniteCacheExpiryPolicy loadExpiryPlc, @Nullable ReaderArguments readerArgs) { - assert false; - return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean hasLockCandidate(GridCacheVersion ver) { - return mvcc.hasCandidate(ver); + return false; } - /** @inheritDoc */ - @Override public boolean lockedByAny(GridCacheVersion... exclude) { - return !mvcc.isEmpty(exclude); + /** {@inheritDoc} */ + @Override public boolean hasLockCandidate(long threadId) { + return false; + } + + /** {@inheritDoc} */ + @Override public boolean lockedByAny(GridCacheVersion... exclude) throws GridCacheEntryRemovedException { + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedByThread() { - return lockedByThread(Thread.currentThread().getId()); + return false; } - /** @inheritDoc */ - @Override public boolean lockedLocally(GridCacheVersion lockVer) { - return mvcc.isLocallyOwned(lockVer); + /** {@inheritDoc} */ + @Override public boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer, long threadId) { + return false; } /** {@inheritDoc} */ - @Override public boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer, long threadId) - throws GridCacheEntryRemovedException { - return lockedLocally(lockVer) || lockedByThread(threadId); + @Override public boolean lockedLocally(GridCacheVersion lockVer) { + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedByThread(long threadId, GridCacheVersion exclude) { - return mvcc.isLocallyOwnedByThread(threadId, false, exclude); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedByThread(long threadId) { - return mvcc.isLocallyOwnedByThread(threadId, true); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedBy(GridCacheVersion ver) { - return mvcc.isOwnedBy(ver); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedByThreadUnsafe(long threadId) { - return mvcc.isLocallyOwnedByThread(threadId, true); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedByUnsafe(GridCacheVersion ver) { - return mvcc.isOwnedBy(ver); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean lockedLocallyUnsafe(GridCacheVersion lockVer) { - return mvcc.isLocallyOwned(lockVer); + return false; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public boolean hasLockCandidateUnsafe(GridCacheVersion ver) { - return mvcc.hasCandidate(ver); + return false; } - /** @inheritDoc */ - @Override public Collection localCandidates(GridCacheVersion... exclude) { - return mvcc.localCandidates(exclude); + /** {@inheritDoc} */ + @Override public @Nullable GridCacheMvccCandidate localCandidate(long threadId) { + return null; } - /** @inheritDoc */ - Collection localCandidates(boolean reentries, GridCacheVersion... exclude) { - return mvcc.localCandidates(reentries, exclude); + /** {@inheritDoc} */ + @Override public Collection localCandidates(@Nullable GridCacheVersion... exclude) { + return null; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public Collection remoteMvccSnapshot(GridCacheVersion... exclude) { - return mvcc.remoteCandidates(exclude); + return null; } /** {@inheritDoc} */ - @Override public GridCacheMvccCandidate localCandidate(long threadId) throws GridCacheEntryRemovedException { - return mvcc.localCandidate(threadId); - } - - /** @inheritDoc */ - @Override public GridCacheMvccCandidate candidate(GridCacheVersion ver) { - return mvcc.candidate(ver); + @Override public @Nullable GridCacheMvccCandidate candidate(GridCacheVersion ver) { + return null; } /** {@inheritDoc} */ - @Override public GridCacheMvccCandidate candidate(UUID nodeId, long threadId) - throws GridCacheEntryRemovedException { - return mvcc.remoteCandidate(nodeId, threadId); + @Override public @Nullable GridCacheMvccCandidate candidate(UUID nodeId, long threadId) { + return null; } - /** - * @return Any MVCC owner. - */ - GridCacheMvccCandidate anyOwner() { - return mvcc.anyOwner(); + /** {@inheritDoc} */ + @Override public @Nullable GridCacheMvccCandidate localOwner() { + return null; } - /** @inheritDoc */ - @Override public GridCacheMvccCandidate localOwner() { - return mvcc.localOwner(); + /** {@inheritDoc} */ + @Override public CacheObject valueBytes() throws GridCacheEntryRemovedException { + return null; } - /** @inheritDoc */ - @Override public CacheObject valueBytes() { - assert false; - + /** {@inheritDoc} */ + @Override public @Nullable CacheObject valueBytes( + @Nullable GridCacheVersion ver) throws IgniteCheckedException, GridCacheEntryRemovedException { return null; } - /** @inheritDoc */ - @Override public CacheObject valueBytes(GridCacheVersion ver) { - assert false; + /** {@inheritDoc} */ + @Override public void updateIndex(SchemaIndexCacheVisitorClosure clo) { - return null; } /** {@inheritDoc} */ @@ -768,8 +490,8 @@ GridCacheMvccCandidate anyOwner() { return 0; } - /** @inheritDoc */ - @Override public long expireTime() { + /** {@inheritDoc} */ + @Override public long expireTime() throws GridCacheEntryRemovedException { return 0; } @@ -788,83 +510,50 @@ GridCacheMvccCandidate anyOwner() { return ttl; } - /** @inheritDoc */ - @Override public long ttl() { + /** {@inheritDoc} */ + @Override public long ttl() throws GridCacheEntryRemovedException { return ttl; } - /** @inheritDoc */ + /** {@inheritDoc} */ @Override public void updateTtl(GridCacheVersion ver, IgniteCacheExpiryPolicy expiryPlc) { - throw new UnsupportedOperationException(); - } - /** @inheritDoc */ - @Override public void updateTtl(GridCacheVersion ver, long ttl) { - throw new UnsupportedOperationException(); } /** {@inheritDoc} */ - @Override public CacheObject unswap() throws IgniteCheckedException { - return null; - } + @Override public void updateTtl(@Nullable GridCacheVersion ver, long ttl) { - /** {@inheritDoc} */ - @Override public CacheObject unswap(boolean needVal) throws IgniteCheckedException { - return null; } /** {@inheritDoc} */ - @Override public CacheObject unswap(CacheDataRow row) throws IgniteCheckedException { + @Override public @Nullable CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException { return null; } /** {@inheritDoc} */ - @Override public boolean hasLockCandidate(long threadId) throws GridCacheEntryRemovedException { - return localCandidate(threadId) != null; - } - - /** {@inheritDoc} */ - @Override public void updateIndex(SchemaIndexCacheVisitorClosure clo) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public boolean deleted() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean obsoleteOrDeleted() { - return false; - } - - /** {@inheritDoc} */ - @Nullable @Override public CacheObject peek(boolean heap, - boolean offheap, - AffinityTopologyVersion topVer, - @Nullable IgniteCacheExpiryPolicy plc) { + @Override public @Nullable CacheObject unswap( + CacheDataRow row) throws IgniteCheckedException, GridCacheEntryRemovedException { return null; } /** {@inheritDoc} */ - @Nullable @Override public CacheObject peek() - throws GridCacheEntryRemovedException, IgniteCheckedException { + @Override public @Nullable CacheObject unswap(boolean needVal) throws IgniteCheckedException, GridCacheEntryRemovedException { return null; } /** {@inheritDoc} */ @Override public void onUnlock() { - // No-op. + } /** {@inheritDoc} */ @Override public void lockEntry() { - // No-op. + } /** {@inheritDoc} */ @Override public void unlockEntry() { - // No-op. + } /** {@inheritDoc} */ @@ -879,6 +568,6 @@ GridCacheMvccCandidate anyOwner() { /** {@inheritDoc} */ @Override public void touch() { - context().evicts().touch(this); + } }