ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-5075
Date Wed, 17 May 2017 14:03:01 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5075 11d2f715a -> 203159696


ignite-5075


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/20315969
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/20315969
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/20315969

Branch: refs/heads/ignite-5075
Commit: 203159696ee2c5c1ea6d8f20632a66a8211bbfce
Parents: 11d2f71
Author: sboikov <sboikov@gridgain.com>
Authored: Wed May 17 17:02:51 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed May 17 17:02:51 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheTtlManager.java     |  7 ++++++-
 .../cache/IgniteCacheOffheapManagerImpl.java      |  2 ++
 .../IgniteCacheClientNearCacheExpiryTest.java     | 18 ++++++++++--------
 3 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/20315969/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
index ad6aa5a..0e3869c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
@@ -44,6 +44,9 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
     private boolean eagerTtlEnabled;
 
     /** */
+    private GridCacheContext dhtCtx;
+
+    /** */
     private final IgniteInClosure2X<GridCacheEntryEx, GridCacheVersion> expireC =
         new IgniteInClosure2X<GridCacheEntryEx, GridCacheVersion>() {
             @Override public void applyx(GridCacheEntryEx entry, GridCacheVersion obsoleteVer)
{
@@ -73,6 +76,8 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
 
     /** {@inheritDoc} */
     @Override protected void start0() throws IgniteCheckedException {
+        dhtCtx = cctx.isNear() ? cctx.near().dht().context() : cctx;
+
         boolean cleanupDisabled = cctx.kernalContext().isDaemon() ||
             !cctx.config().isEagerTtl() ||
             CU.isAtomicsCache(cctx.name()) ||
@@ -189,7 +194,7 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
                 }
             }
 
-            boolean more = cctx.offheap().expire(cctx, expireC, amount);
+            boolean more = cctx.offheap().expire(dhtCtx, expireC, amount);
 
             if (more)
                 return true;

http://git-wip-us.apache.org/repos/asf/ignite/blob/20315969/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index e185f53..8da7357 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -826,6 +826,8 @@ public class IgniteCacheOffheapManagerImpl implements IgniteCacheOffheapManager
         IgniteInClosure2X<GridCacheEntryEx, GridCacheVersion> c,
         int amount
     ) throws IgniteCheckedException {
+        assert !cctx.isNear() : cctx.name();
+
         if (hasPendingEntries && pendingEntries != null) {
             GridCacheVersion obsoleteVer = null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/20315969/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java
index d2e7caf..3417ba8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java
@@ -28,7 +28,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap;
+import org.apache.ignite.internal.processors.cache.GridCacheLocalConcurrentMap;
 import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -83,6 +83,13 @@ public class IgniteCacheClientNearCacheExpiryTest extends IgniteCacheAbstractTes
     public void testExpirationOnClient() throws Exception {
         Ignite ignite = grid(NODES - 1);
 
+        // Check size of near entries via reflection because entries is filtered for size()
API call.
+        IgniteEx igniteEx = (IgniteEx)ignite;
+
+        GridCacheAdapter internalCache = igniteEx.context().cache().internalCache(DEFAULT_CACHE_NAME);
+
+        GridCacheLocalConcurrentMap map = GridTestUtils.getFieldValue(internalCache, GridCacheAdapter.class,
"map");
+
         assertTrue(ignite.configuration().isClientMode());
 
         IgniteCache<Object, Object> cache = ignite.cache(DEFAULT_CACHE_NAME);
@@ -102,14 +109,9 @@ public class IgniteCacheClientNearCacheExpiryTest extends IgniteCacheAbstractTes
             assertEquals(i, cacheWithExpiry.localPeek(i));
         }
 
-        U.sleep(1000);
+        assertEquals(KEYS_COUNT * 2, map.publicSize(internalCache.context().cacheId()));
 
-        // Check size of near entries via reflection because entries is filtered for size()
API call.
-        IgniteEx igniteEx = (IgniteEx)ignite;
-
-        GridCacheAdapter internalCache = igniteEx.context().cache().internalCache(DEFAULT_CACHE_NAME);
-
-        GridCacheConcurrentMap map = GridTestUtils.getFieldValue(internalCache, GridCacheAdapter.class,
"map");
+        U.sleep(1000);
 
         assertEquals(KEYS_COUNT, map.publicSize(internalCache.context().cacheId()));
 


Mime
View raw message