/** * @param entries Entries. * @return Not null exception if version check failed. * @throws IgniteCheckedException If failed. */ @Nullable private IgniteCheckedException checkReadConflict(Iterable<IgniteTxEntry> entries) throws IgniteCheckedException { try { for (IgniteTxEntry entry : entries) { GridCacheVersion serReadVer = entry.entryReadVersion(); if (serReadVer != null) { entry.cached().unswap(); if (!entry.cached().checkSerializableReadVersion(serReadVer)) return versionCheckError(entry); } } } catch (GridCacheEntryRemovedException ignore) { assert false : "Got removed exception on entry with dht local candidate: " + entries; } return null; }
entry = cache.entryEx(keys.get(i)); entry.unswap(false);
/** * JUnit. * * @throws Exception If failed. */ @Test public void testEnabled() throws Exception { storeValBytes = true; Ignite g0 = startGrid(0); Ignite g1 = startGrid(1); IgniteCache<Integer, String> c = g0.cache(DEFAULT_CACHE_NAME); c.put(1, "Cached value"); GridCacheEntryEx entry = ((IgniteKernal)g1).internalCache(DEFAULT_CACHE_NAME).entryEx(1); assert entry != null; entry.unswap(); assert entry.valueBytes() != null; } }
/** {@inheritDoc} */ @Override public IgnitePair<Long> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception { GridCacheAdapter<?, ?> internalCache = internalCache0(cache); if (internalCache.context().isNear()) internalCache = internalCache.context().near().dht(); GridCacheEntryEx entry = internalCache.entryEx(key); entry.unswap(); if (!entry.hasValue()) { assertEquals(0, entry.ttl()); assertEquals(0, entry.expireTime()); return null; } IgnitePair<Long> pair = new IgnitePair<>(entry.ttl(), entry.expireTime()); if (!entry.isNear()) entry.context().cache().removeEntry(entry); return pair; } }
/** {@inheritDoc} */ @Override public IgnitePair<Long> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception { GridCacheAdapter<?, ?> internalCache = internalCache0(cache); if (useDhtForNearCache && internalCache.context().isNear()) internalCache = internalCache.context().near().dht(); GridCacheEntryEx entry = internalCache.entryEx(key); entry.unswap(); IgnitePair<Long> pair = new IgnitePair<>(entry.ttl(), entry.expireTime()); if (!entry.isNear()) entry.context().cache().removeEntry(entry); return pair; } }
entry = ctx.dht().entryEx(k); entry.unswap();
dhtEntry.unswap();
entry.unswap(true);
entry.unswap();
GridCacheEntryEx entry = cache.entryEx(key); entry.unswap(tmp);
/** * @param e Entry. * @param cache Cache. * @throws Exception If failed. */ private void compareVersionWithPrimaryNode(CacheEntry<Integer, ?> e, IgniteCache<Integer, TestValue> cache) throws Exception { CacheConfiguration cfg = cache.getConfiguration(CacheConfiguration.class); if (cfg.getCacheMode() != LOCAL) { Ignite prim = primaryNode(e.getKey(), cache.getName()); GridCacheAdapter<Object, Object> cacheAdapter = ((IgniteKernal)prim).internalCache(cache.getName()); if (cfg.getNearConfiguration() != null) cacheAdapter = ((GridNearCacheAdapter)cacheAdapter).dht(); IgniteCacheObjectProcessor cacheObjects = cacheAdapter.context().cacheObjects(); CacheObjectContext cacheObjCtx = cacheAdapter.context().cacheObjectContext(); GridCacheEntryEx mapEntry = cacheAdapter.entryEx(cacheObjects.toCacheKeyObject( cacheObjCtx, cacheAdapter.context(), e.getKey(), true)); mapEntry.unswap(); assertNotNull("No entry for key: " + e.getKey(), mapEntry); assertEquals(mapEntry.version(), e.version()); } }
entry1.unswap();
e = cache.entryEx(key); e.unswap();
assertTrue("Not found " + key, !cache.affinity().isPrimaryOrBackup(grid.localNode(), key)); else { e.unswap();
txEntry.conflictExpireTime() == CU.EXPIRE_TIME_CALCULATE) { if (expiry != null) { cached.unswap(true);