You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/04/03 13:21:23 UTC
[01/23] incubator-ignite git commit: ignite-645 Remove
GridCachePeekMode
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-593 44b1bb24a -> 520cc47be
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
index 1ab738f..a0d9f03 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
@@ -158,13 +158,13 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertTrue(cache1.containsKey(1));
assertTrue(cache1.containsKey(2));
- assertNotNull(near(cache1).peek(1));
- assertNotNull(near(cache1).peek(2));
- assertNotNull(dht(cache1).peek(1));
- assertNull(dht(cache1).peek(2));
+ assertNotNull(nearPeek(cache1, 1));
+ assertNotNull(nearPeek(cache1, 2));
+ assertNotNull(dhtPeek(cache1, 1));
+ assertNull(dhtPeek(cache1, 2));
- assertNull(near(cache2).peek(1));
- assertNotNull(dht(cache2).peek(2));
+ assertNull(nearPeek(cache2, 1));
+ assertNotNull(dhtPeek(cache2, 2));
// Node2 should have node1 in reader's map, since request to
// put key 2 came from node1.
@@ -177,7 +177,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals("v1", cache2.get(1));
// Check that key1 is in near cache of cache2.
- assertNotNull(near(cache2).peek(1));
+ assertNotNull(nearPeek(cache2, 1));
// Now node1 should have node2 in readers map.
assertTrue(e1.readers().contains(n2.id()));
@@ -185,8 +185,8 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
// Evict locally from cache2.
cache2.localEvict(Collections.singleton(1));
- assertNull(near(cache2).peek(1));
- assertNull(dht(cache2).peek(1));
+ assertNull(nearPeek(cache2, 1));
+ assertNull(dhtPeek(cache2, 1));
// Node 1 still has node2 in readers map.
assertTrue(e1.readers().contains(n2.id()));
@@ -240,10 +240,10 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertTrue(cache1.containsKey(1));
assertTrue(cache2.containsKey(1));
- assertEquals("v1", near(cache1).peek(1));
- assertEquals("v1", near(cache2).peek(1));
- assertEquals("v1", dht(cache1).peek(1));
- assertEquals("v1", dht(cache2).peek(1));
+ assertEquals("v1", nearPeek(cache1, 1));
+ assertEquals("v1", nearPeek(cache2, 1));
+ assertEquals("v1", dhtPeek(cache1, 1));
+ assertEquals("v1", dhtPeek(cache2, 1));
assertNull(near(cache1).peekNearOnly(1));
assertNull(near(cache2).peekNearOnly(1));
@@ -256,10 +256,10 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertTrue(cache1.containsKey(2));
assertTrue(cache2.containsKey(2));
- assertEquals("v2", near(cache1).peek(2));
- assertEquals("v2", near(cache2).peek(2));
- assertEquals("v2", dht(cache1).peek(2));
- assertEquals("v2", dht(cache2).peek(2));
+ assertEquals("v2", nearPeek(cache1, 2));
+ assertEquals("v2", nearPeek(cache2, 2));
+ assertEquals("v2", dhtPeek(cache1, 2));
+ assertEquals("v2", dhtPeek(cache2, 2));
assertNull(near(cache1).peekNearOnly(2));
assertNull(near(cache2).peekNearOnly(2));
@@ -284,7 +284,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache2.localEvict(Collections.singleton(1));
assertNull(near(cache2).peekNearOnly(1));
- assertEquals("v1", dht(cache2).peek(1));
+ assertEquals("v1", dhtPeek(cache2, 1));
assertEquals("v1", cache1.getAndPut(1, "z1"));
@@ -292,7 +292,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertFalse(e1.readers().contains(n2.id()));
assertNull(near(cache2).peekNearOnly(1));
- assertEquals("z1", dht(cache2).peek(1));
+ assertEquals("z1", dhtPeek(cache2, 1));
}
/** @throws Exception If failed. */
@@ -443,9 +443,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertNull(cache.getAndPut(key1, val1));
- assertEquals(val1, dht(0).peek(key1));
- assertEquals(val1, dht(1).peek(key1));
- assertNull(dht(2).peek(key1));
+ assertEquals(val1, dhtPeek(0, key1));
+ assertEquals(val1, dhtPeek(1, key1));
+ assertNull(dhtPeek(2, key1));
assertNull(near(0).peekNearOnly(key1));
assertNull(near(1).peekNearOnly(key1));
@@ -453,9 +453,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.put(key2, val2);
- assertNull(dht(0).peek(key2));
- assertEquals(val2, dht(1).peek(key2));
- assertEquals(val2, dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertEquals(val2, dhtPeek(1, key2));
+ assertEquals(val2, dhtPeek(2, key2));
assertEquals(val2, near(0).peekNearOnly(key2));
assertNull(near(1).peekNearOnly(key2));
@@ -465,9 +465,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.put(key2, val22);
- assertNull(dht(0).peek(key2));
- assertEquals(val22, dht(1).peek(key2));
- assertEquals(val22, dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertEquals(val22, dhtPeek(1, key2));
+ assertEquals(val22, dhtPeek(2, key2));
assertEquals(val22, near(0).peekNearOnly(key2));
assertNull(near(1).peekNearOnly(key2));
@@ -475,9 +475,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.remove(key2);
- assertNull(dht(0).peek(key2));
- assertNull(dht(1).peek(key2));
- assertNull(dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertNull(dhtPeek(1, key2));
+ assertNull(dhtPeek(2, key2));
assertNull(near(0).peekNearOnly(key2));
assertNull(near(1).peekNearOnly(key2));
@@ -485,9 +485,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.remove(key1);
- assertNull(dht(0).peek(key1));
- assertNull(dht(1).peek(key1));
- assertNull(dht(2).peek(key1));
+ assertNull(dhtPeek(0, key1));
+ assertNull(dhtPeek(1, key1));
+ assertNull(dhtPeek(2, key1));
assertNull(near(0).peekNearOnly(key1));
assertNull(near(1).peekNearOnly(key1));
@@ -536,9 +536,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
try {
assertNull(cache.getAndPut(key1, val1));
- assertEquals(val1, dht(0).peek(key1));
- assertEquals(val1, dht(1).peek(key1));
- assertNull(dht(2).peek(key1));
+ assertEquals(val1, dhtPeek(0, key1));
+ assertEquals(val1, dhtPeek(1, key1));
+ assertNull(dhtPeek(2, key1));
// Since near entry holds the lock, it should
// contain correct value.
@@ -549,9 +549,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.put(key2, val2);
- assertNull(dht(0).peek(key2));
- assertEquals(val2, dht(1).peek(key2));
- assertEquals(val2, dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertEquals(val2, dhtPeek(1, key2));
+ assertEquals(val2, dhtPeek(2, key2));
assertEquals(val2, near(0).peekNearOnly(key2));
assertNull(near(1).peekNearOnly(key2));
@@ -561,9 +561,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.put(key2, val22);
- assertNull(dht(0).peek(key2));
- assertEquals(val22, dht(1).peek(key2));
- assertEquals(val22, dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertEquals(val22, dhtPeek(1, key2));
+ assertEquals(val22, dhtPeek(2, key2));
assertEquals(val22, near(0).peekNearOnly(key2));
assertNull(near(1).peekNearOnly(key2));
@@ -571,9 +571,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
cache.remove(key2);
- assertNull(dht(0).peek(key2));
- assertNull(dht(1).peek(key2));
- assertNull(dht(2).peek(key2));
+ assertNull(dhtPeek(0, key2));
+ assertNull(dhtPeek(1, key2));
+ assertNull(dhtPeek(2, key2));
assertNull(dht(0).peekEx(key2));
assertNotNull(dht(1).peekEx(key2));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
index 51c2047..9ebbebc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
@@ -148,7 +148,6 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If test failed.
*/
- @SuppressWarnings({"BusyWait"})
public void testIntegrity() throws Exception {
preloadMode = SYNC;
@@ -188,12 +187,14 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
assertEquals(EVT_CACHE_REBALANCE_STARTED, iter.next().type());
assertEquals(EVT_CACHE_REBALANCE_STOPPED, iter.next().type());
- GridCacheAdapter<Integer, String> cache2 = ((IgniteKernal)g2).internalCache(null);
+ IgniteCache<Integer, String> cache2 = g2.cache(null);
+
+ assertEquals("val1", cache2.localPeek(1, CachePeekMode.ONHEAP));
+ assertEquals("val2", cache2.localPeek(2, CachePeekMode.ONHEAP));
- assertEquals("val1", cache2.peek(1));
- assertEquals("val2", cache2.peek(2));
+ GridCacheAdapter<Integer, String> cacheAdapter2 = ((IgniteKernal)g2).internalCache(null);
- GridCacheEntryEx e2 = cache2.peekEx(1);
+ GridCacheEntryEx e2 = cacheAdapter2.peekEx(1);
assert e2 != null;
assert e2 != e1;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
index b110bfa..96229c0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
@@ -209,7 +209,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
IgfsFileImpl info = (IgfsFileImpl)igfs.info(path);
for (int i = 0; i < nodesCount(); i++) {
- IgfsFileInfo fileInfo = (IgfsFileInfo)grid(i).cachex(metaCacheName).peek(info.fileId());
+ IgfsFileInfo fileInfo =
+ (IgfsFileInfo)grid(i).cachex(metaCacheName).localPeek(info.fileId(), ONHEAP_PEEK_MODES, null);
assertNotNull(fileInfo);
assertNotNull(fileInfo.listing());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index 3a49e6c..2b6c62a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -404,7 +404,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
// Await for actual delete to occur.
for (IgfsBlock block : file.blocks()) {
for (int i = 0; i < GRID_CNT; i++) {
- while (cache(grid(i).localNode().id()).peek(block.key()) != null)
+ while (localPeek(cache(grid(i).localNode().id()), block.key()) != null)
U.sleep(100);
}
}
@@ -651,39 +651,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
}
/**
- * Create block key.
- *
- * @param path Path.
- * @param blockId Block ID.
- * @return Block key.
- * @throws Exception If failed.
- */
- private IgfsBlockKey blockKey(IgfsPath path, long blockId) throws Exception {
- IgfsEx igfs0 = (IgfsEx)grid(0).fileSystem(IGFS_NAME);
-
- IgniteUuid fileId = igfs0.context().meta().fileId(path);
-
- return new IgfsBlockKey(fileId, null, true, blockId);
- }
-
- /**
- * Determine primary node for the given block key.
- *
- * @param key Block key.
- * @return Node ID.
- */
- private UUID primary(IgfsBlockKey key) {
- IgniteEx grid = grid(0);
-
- for (ClusterNode node : grid.cluster().nodes()) {
- if (grid.affinity(DATA_CACHE_NAME).isPrimary(node, key))
- return node.id();
- }
-
- return null;
- }
-
- /**
* Determine primary and backup node IDs for the given block key.
*
* @param key Block key.
@@ -714,17 +681,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
}
/**
- * Get IGFS of the given node.
- *
- * @param ignite Node;
- * @return IGFS.
- * @throws Exception If failed.
- */
- private IgfsImpl igfs(Ignite ignite) throws Exception {
- return (IgfsImpl) ignite.fileSystem(IGFS_NAME);
- }
-
- /**
* Get data cache for the given node ID.
*
* @param nodeId Node ID.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 9dd40d0..b890692 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -52,6 +52,9 @@ import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
* Super class for all common tests.
*/
public abstract class GridCommonAbstractTest extends GridAbstractTest {
+ /**Cache peek modes array that consist of only ONHEAP mode. */
+ protected static final CachePeekMode[] ONHEAP_PEEK_MODES = new CachePeekMode[] {CachePeekMode.ONHEAP};
+
/**
* @param startGrid If {@code true}, then grid node will be auto-started.
*/
@@ -552,6 +555,45 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
}
/**
+ * @param key Key.
+ */
+ protected <K, V> V dhtPeek(K key) throws IgniteCheckedException {
+ return localPeek(this.<K, V>dht(), key);
+ }
+
+ /**
+ * @param idx Index.
+ * @param key Key.
+ */
+ protected <K, V> V dhtPeek(int idx, K key) throws IgniteCheckedException {
+ return localPeek(this.<K, V>dht(idx), key);
+ }
+
+ /**
+ * @param cache Cache.
+ * @param key Key.
+ */
+ protected <K, V> V nearPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
+ return localPeek(near(cache), key);
+ }
+
+ /**
+ * @param cache Cache.
+ * @param key Key.
+ */
+ protected static <K, V> V dhtPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
+ return localPeek(dht(cache), key);
+ }
+
+ /**
+ * @param cache Cache.
+ * @param key Key.
+ */
+ protected static <K, V> V localPeek(GridCacheAdapter<K, V> cache, K key) throws IgniteCheckedException {
+ return cache.localPeek(key, ONHEAP_PEEK_MODES, null);
+ }
+
+ /**
* @param comp Compute.
* @param task Task.
* @param arg Task argument.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
index c650b6b..ad41bc5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
@@ -99,7 +99,7 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {
cache.put(i, new ObjectValue("test" + i, i));
for (int i = 0; i < cnt; i++) {
- assertNotNull(cache.peek(i));
+ assertNotNull(localPeek(cache, i));
cache.evict(i); // Swap.
}
[16/23] incubator-ignite git commit: # ignite-sprint-3 Removed
queryTimeout
Posted by ak...@apache.org.
# ignite-sprint-3 Removed queryTimeout
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d33191c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d33191c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d33191c5
Branch: refs/heads/ignite-593
Commit: d33191c5c1965c97a093d49017ae691c7f5289a5
Parents: 6c3f101
Author: anovikov <an...@gridgain.com>
Authored: Fri Apr 3 14:34:49 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Fri Apr 3 14:34:49 2015 +0700
----------------------------------------------------------------------
.../visor/cache/VisorCacheDefaultConfiguration.java | 10 ----------
.../ignite/visor/commands/cache/VisorCacheCommand.scala | 3 +--
2 files changed, 1 insertion(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d33191c5/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
index a0d9990..998b921 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
@@ -32,9 +32,6 @@ public class VisorCacheDefaultConfiguration implements Serializable {
/** Default transaction timeout. */
private long txLockTimeout;
- /** Default query timeout. */
- private long qryTimeout;
-
/**
* @param ccfg Cache configuration.
* @return Data transfer object for default cache configuration properties.
@@ -54,13 +51,6 @@ public class VisorCacheDefaultConfiguration implements Serializable {
return txLockTimeout;
}
- /**
- * @return Default query timeout.
- */
- public long queryTimeout() {
- return qryTimeout;
- }
-
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(VisorCacheDefaultConfiguration.class, this);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d33191c5/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 4365364..539d3d2 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -722,7 +722,7 @@ object VisorCacheCommand {
/** Default cache name to show on screen. */
private final val DFLT_CACHE_NAME = escapeName(null)
-
+
/** Default cache key. */
protected val DFLT_CACHE_KEY = DFLT_CACHE_NAME + "-" + UUID.randomUUID().toString
@@ -804,7 +804,6 @@ object VisorCacheCommand {
cacheT += ("Near Eviction Policy Max Size", safe(nearCfg.nearEvictMaxSize()))
cacheT += ("Default Lock Timeout", defaultCfg.txLockTimeout())
- cacheT += ("Default Query Timeout", defaultCfg.queryTimeout())
cacheT += ("Metadata type count", cfg.typeMeta().size())
cacheT += ("Cache Interceptor", safe(cfg.interceptor()))
[18/23] incubator-ignite git commit: Merge branch 'ignite-645' into
ignite-sprint-3
Posted by ak...@apache.org.
Merge branch 'ignite-645' into ignite-sprint-3
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7cb512ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7cb512ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7cb512ac
Branch: refs/heads/ignite-593
Commit: 7cb512acae1476f6d740e8cb79cbd8fa9f8314a0
Parents: d173f37 6a721d7
Author: Andrey Gura <ag...@gridgain.com>
Authored: Fri Apr 3 12:04:43 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Fri Apr 3 12:04:43 2015 +0300
----------------------------------------------------------------------
.../cache/CacheEvictableEntryImpl.java | 11 +-
.../processors/cache/CacheProjection.java | 36 ---
.../processors/cache/GridCacheAdapter.java | 257 +------------------
.../cache/GridCacheDeploymentManager.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 55 +---
.../processors/cache/GridCacheMapEntry.java | 232 +----------------
.../processors/cache/GridCachePeekMode.java | 81 ------
.../cache/GridCacheProjectionImpl.java | 11 -
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheUtils.java | 11 -
.../distributed/dht/GridDhtCacheAdapter.java | 9 +-
.../dht/atomic/GridDhtAtomicCache.java | 29 +--
.../dht/colocated/GridDhtColocatedCache.java | 30 +--
.../distributed/near/GridNearCacheAdapter.java | 72 +-----
.../distributed/near/GridNearTxRemote.java | 11 +-
.../processors/task/GridTaskProcessor.java | 9 +-
.../resources/META-INF/classnames.properties | 1 -
.../GridCachePreloadingEvictionsSelfTest.java | 4 +-
.../processors/cache/GridCacheTestEntryEx.java | 40 +--
...GridCacheDhtEvictionNearReadersSelfTest.java | 14 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 24 +-
.../dht/GridCacheDhtMappingSelfTest.java | 2 +-
.../near/GridCacheNearMultiNodeSelfTest.java | 103 +++-----
.../near/GridCacheNearOneNodeSelfTest.java | 33 +--
.../near/GridCacheNearReadersSelfTest.java | 154 +++++------
.../GridCacheReplicatedPreloadSelfTest.java | 11 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 3 +-
.../processors/igfs/IgfsSizeSelfTest.java | 46 +---
.../junits/common/GridCommonAbstractTest.java | 42 +++
.../cache/GridIndexingWithNoopSwapSelfTest.java | 2 +-
30 files changed, 291 insertions(+), 1073 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7cb512ac/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
[23/23] incubator-ignite git commit: # IGNITE-593 WIP.
Posted by ak...@apache.org.
# IGNITE-593 WIP.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/520cc47b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/520cc47b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/520cc47b
Branch: refs/heads/ignite-593
Commit: 520cc47be0d53dc9b72409a56618231ce985cda7
Parents: 0a81542
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Apr 3 18:21:35 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Apr 3 18:21:35 2015 +0700
----------------------------------------------------------------------
.../ignite/internal/visor/cache/VisorCache.java | 7 +-
.../VisorCacheConfigurationCollectorJob.java | 74 ++++++++++++++++++++
.../VisorCacheConfigurationCollectorTask.java | 61 ++++++++++++++++
.../VisorIgfsProfilerUniformityCounters.java | 6 +-
.../visor/node/VisorIgfsConfiguration.java | 2 +-
.../visor/node/VisorRestConfiguration.java | 1 +
.../internal/visor/util/VisorTaskUtils.java | 3 +-
7 files changed, 145 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index 56aefff..6245017 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -101,12 +101,12 @@ public class VisorCache implements Serializable {
* @param cacheName Cache name.
* @param sample Sample size.
* @return Data transfer object for given cache.
- * @throws IgniteCheckedException
+ * @throws IgniteCheckedException If failed to create data transfer object.
*/
- public static VisorCache from(Ignite ignite, String cacheName, int sample) throws IgniteCheckedException {
+ public static VisorCache from(IgniteEx ignite, String cacheName, int sample) throws IgniteCheckedException {
assert ignite != null;
- GridCacheAdapter ca = ((IgniteKernal)ignite).internalCache(cacheName);
+ GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
// Cache was not started.
if (ca == null || !ca.context().started())
@@ -132,7 +132,6 @@ public class VisorCache implements Serializable {
CacheMode mode = cfg.getCacheMode();
-
boolean partitioned = (mode == CacheMode.PARTITIONED || mode == CacheMode.REPLICATED)
&& ca.context().affinityNode();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
new file mode 100644
index 0000000..aee75f6
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.cache;
+
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+import org.apache.ignite.lang.*;
+
+import java.util.*;
+
+/**
+ * Job that collect cache metrics from node.
+ */
+public class VisorCacheConfigurationCollectorJob extends VisorJob<Collection<IgniteUuid>,
+ Map<IgniteUuid, VisorCacheConfiguration>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Create job with given argument.
+ *
+ * @param arg Whether to collect metrics for all caches or for specified cache name only.
+ * @param debug Debug flag.
+ */
+ public VisorCacheConfigurationCollectorJob(Collection<IgniteUuid> arg, boolean debug) {
+ super(arg, debug);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Map<IgniteUuid, VisorCacheConfiguration> run(Collection<IgniteUuid> arg) {
+ Collection<GridCacheAdapter<?, ?>> caches = ignite.context().cache().internalCaches();
+
+ Map<IgniteUuid, VisorCacheConfiguration> res = U.newHashMap(caches.size());
+
+ for (GridCacheAdapter<?, ?> cache : caches) {
+ IgniteUuid deploymentId = cache.context().dynamicDeploymentId();
+
+ if (arg.contains(deploymentId))
+ res.put(deploymentId, config(cache.configuration()));
+ }
+
+ return res;
+ }
+
+ /**
+ * @param ccfg Cache configuration.
+ * @return Data transfer object to send it to Visor.
+ */
+ protected VisorCacheConfiguration config(CacheConfiguration ccfg) {
+ return new VisorCacheConfiguration().from(ignite, ccfg);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorCacheConfigurationCollectorJob.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorTask.java
new file mode 100644
index 0000000..9552c86
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorTask.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.internal.processors.task.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Task that collect cache metrics from all nodes.
+ */
+@GridInternal
+public class VisorCacheConfigurationCollectorTask extends VisorMultiNodeTask<Collection<IgniteUuid>,
+ Map<UUID, Map<IgniteUuid, VisorCacheConfiguration>>, Map<IgniteUuid, VisorCacheConfiguration>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** {@inheritDoc} */
+ @Override protected VisorCacheConfigurationCollectorJob job(Collection<IgniteUuid> arg) {
+ return new VisorCacheConfigurationCollectorJob(arg, debug);
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override protected Map<UUID, Map<IgniteUuid, VisorCacheConfiguration>> reduce0(
+ List<ComputeJobResult> results)
+ throws IgniteException {
+ Map<UUID, Map<IgniteUuid, VisorCacheConfiguration>> taskRes = U.newHashMap(results.size());
+
+ for (ComputeJobResult jobRes : results) {
+ if (jobRes.getException() != null)
+ throw jobRes.getException();
+
+ Map<IgniteUuid, VisorCacheConfiguration> ccfgs = jobRes.getData();
+
+ taskRes.put(jobRes.getNode().id(), ccfgs);
+ }
+
+ return taskRes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
index 7bbafd5..1ce1c64 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
@@ -26,9 +26,9 @@ import static org.apache.ignite.internal.visor.igfs.VisorIgfsProfiler.*;
/**
* Class to support uniformity calculation.
- *<p>
- *<a href="http://en.wikipedia.org/wiki/Coefficient_of_variation">Uniformity calculated as coefficient of variation.</a>
- *</p>
+ * <p>
+ * <a href="http://en.wikipedia.org/wiki/Coefficient_of_variation">Uniformity calculated as coefficient of variation.</a>
+ * </p>
* Count read frequency for each file and compare with ideal uniform distribution.
*/
public class VisorIgfsProfilerUniformityCounters implements Serializable {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index d0b0124..3bd27b4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -158,7 +158,7 @@ public class VisorIgfsConfiguration implements Serializable {
cfg.fragmentizerThrottlingBlockLen = igfs.getFragmentizerThrottlingBlockLength();
cfg.fragmentizerThrottlingDelay = igfs.getFragmentizerThrottlingDelay();
- IgfsIpcEndpointConfiguration endpointCfg = igfs.getIpcEndpointConfiguration();
+ IgfsIpcEndpointConfiguration endpointCfg = igfs.getIpcEndpointConfiguration();
cfg.ipcEndpointCfg = endpointCfg != null ? endpointCfg.toString() : null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
index f279253..e2ac497 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
@@ -93,6 +93,7 @@ public class VisorRestConfiguration implements Serializable {
public boolean restEnabled() {
return restEnabled;
}
+
/**
* @return Whether or not SSL is enabled for TCP binary protocol.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/520cc47b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
index 1209a40..b7f852a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
@@ -836,7 +836,8 @@ public class VisorTaskUtils {
zos.putNextEntry(entry);
zos.write(input);
- } finally {
+ }
+ finally {
zos.closeEntry();
}
}
[03/23] incubator-ignite git commit: ignite-10009: Add tests.
Posted by ak...@apache.org.
ignite-10009: Add tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b8f6904a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b8f6904a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b8f6904a
Branch: refs/heads/ignite-593
Commit: b8f6904a37495f5473cbb9fd572ee3d9e7a7c6af
Parents: 6413426
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Apr 1 17:36:38 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Apr 1 17:36:38 2015 +0300
----------------------------------------------------------------------
.../cache/ttl/CacheTtlAbstractSelfTest.java | 199 +++++++++++++++++++
.../ttl/CacheTtlOffheapAbstractSelfTest.java | 29 +++
.../CacheTtlOffheapAtomicAbstractSelfTest.java | 29 +++
.../ttl/CacheTtlOffheapAtomicLocalSelfTest.java | 34 ++++
...acheTtlOffheapAtomicPartitionedSelfTest.java | 34 ++++
...TtlOffheapTransactionalAbstractSelfTest.java | 29 +++
...cheTtlOffheapTransactionalLocalSelfTest.java | 34 ++++
...OffheapTransactionalPartitionedSelfTest.java | 34 ++++
.../ttl/CacheTtlOnheapAbstractSelfTest.java | 29 +++
.../CacheTtlOnheapAtomicAbstractSelfTest.java | 29 +++
.../ttl/CacheTtlOnheapAtomicLocalSelfTest.java | 34 ++++
...CacheTtlOnheapAtomicPartitionedSelfTest.java | 34 ++++
...eTtlOnheapTransactionalAbstractSelfTest.java | 29 +++
...acheTtlOnheapTransactionalLocalSelfTest.java | 34 ++++
14 files changed, 611 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
new file mode 100644
index 0000000..25d32c0
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.eviction.lru.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import javax.cache.expiry.*;
+import java.util.*;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
+/**
+ * TTL test.
+ */
+public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final int MAX_CACHE_SIZE = 5;
+
+ /** */
+ private static final int SIZE = 11;
+
+ /** */
+ private static final long DEFAULT_TIME_TO_LIVE = 2000;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration cache = new CacheConfiguration();
+
+ cache.setCacheMode(cacheMode());
+ cache.setAtomicityMode(atomicityMode());
+ cache.setMemoryMode(memoryMode());
+ cache.setOffHeapMaxMemory(0);
+ cache.setDefaultTimeToLive(DEFAULT_TIME_TO_LIVE);
+ cache.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
+ cache.setIndexedTypes(Integer.class, Integer.class);
+
+ cfg.setCacheConfiguration(cache);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(disco);
+
+ return cfg;
+ }
+
+ /**
+ * @return Atomicity mode.
+ */
+ protected abstract CacheAtomicityMode atomicityMode();
+
+ /**
+ * @return Memory mode.
+ */
+ protected abstract CacheMemoryMode memoryMode();
+
+ /**
+ * @return Cache mode.
+ */
+ protected abstract CacheMode cacheMode();
+
+ /**
+ * @return GridCount
+ */
+ protected abstract int gridCount();
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(gridCount());
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDefaultTimeToLivePut() throws Exception {
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ List<Integer> keys = primaryKeys(cache, 1);
+
+ cache.put(keys.get(0), 1);
+
+ checkSizeBeforeLive(cache, 1);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDefaultTimeToLivePutAll() throws Exception {
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ Map<Integer, Integer> entries = new HashMap<>();
+
+ List<Integer> keys = primaryKeys(cache, SIZE);
+
+ for (int i = 0; i < SIZE; ++i)
+ entries.put(keys.get(i), i);
+
+ cache.putAll(entries);
+
+ checkSizeBeforeLive(cache, SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTimeToLiveTtl() throws Exception {
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ long time = DEFAULT_TIME_TO_LIVE + 2000;
+
+ List<Integer> keys = primaryKeys(cache, SIZE);
+
+ for (int i = 0; i < SIZE; i++)
+ cache.withExpiryPolicy(new TouchedExpiryPolicy(new Duration(MILLISECONDS, time))).
+ put(keys.get(i), i);
+
+ checkSizeBeforeLive(cache, SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeBeforeLive(cache, SIZE);
+
+ Thread.sleep(time - DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ private void checkSizeBeforeLive(IgniteCache<Integer, Integer> cache, int size) throws Exception {
+ if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) {
+ assertEquals(0, cache.localSize());
+ assertEquals(size, cache.localSize(CachePeekMode.OFFHEAP));
+ }
+ else {
+ assertEquals(size > MAX_CACHE_SIZE ? MAX_CACHE_SIZE : size, cache.localSize());
+ assertEquals(size > MAX_CACHE_SIZE ? size - MAX_CACHE_SIZE : 0, cache.localSize(CachePeekMode.OFFHEAP));
+ }
+
+ assertFalse(cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().isEmpty());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ private void checkSizeAfterLive() throws Exception {
+ for (int i = 0; i < gridCount(); ++i) {
+ IgniteCache<Integer, Integer> cache = jcache(i);
+
+ assertEquals(0, cache.localSize());
+ assertEquals(0, cache.localSize(CachePeekMode.OFFHEAP));
+ assertEquals(0, cache.localSize(CachePeekMode.SWAP));
+ assertEquals(0, cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().size());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
new file mode 100644
index 0000000..59ed837
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOffheapAbstractSelfTest extends CacheTtlAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
new file mode 100644
index 0000000..aac984e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOffheapAtomicAbstractSelfTest extends CacheTtlOffheapAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.ATOMIC;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
new file mode 100644
index 0000000..0772c57
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOffheapAtomicLocalSelfTest extends CacheTtlOffheapAtomicAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.LOCAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicPartitionedSelfTest.java
new file mode 100644
index 0000000..9a86138
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicPartitionedSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOffheapAtomicPartitionedSelfTest extends CacheTtlOffheapAtomicAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalAbstractSelfTest.java
new file mode 100644
index 0000000..8b73812
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOffheapTransactionalAbstractSelfTest extends CacheTtlOffheapAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalLocalSelfTest.java
new file mode 100644
index 0000000..2596e76
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalLocalSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOffheapTransactionalLocalSelfTest extends CacheTtlOffheapTransactionalAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.LOCAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalPartitionedSelfTest.java
new file mode 100644
index 0000000..6eb52f8
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapTransactionalPartitionedSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOffheapTransactionalPartitionedSelfTest extends CacheTtlOffheapTransactionalAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAbstractSelfTest.java
new file mode 100644
index 0000000..7bce6d9
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOnheapAbstractSelfTest extends CacheTtlAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.ONHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicAbstractSelfTest.java
new file mode 100644
index 0000000..5ba9ee7
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOnheapAtomicAbstractSelfTest extends CacheTtlOnheapAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.ATOMIC;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicLocalSelfTest.java
new file mode 100644
index 0000000..5e5f9b9
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicLocalSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOnheapAtomicLocalSelfTest extends CacheTtlOnheapAtomicAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.LOCAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicPartitionedSelfTest.java
new file mode 100644
index 0000000..dc2dc95
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapAtomicPartitionedSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOnheapAtomicPartitionedSelfTest extends CacheTtlOnheapAtomicAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalAbstractSelfTest.java
new file mode 100644
index 0000000..4e9bc10
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlOnheapTransactionalAbstractSelfTest extends CacheTtlOnheapAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return CacheAtomicityMode.TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8f6904a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalLocalSelfTest.java
new file mode 100644
index 0000000..f68c317
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalLocalSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOnheapTransactionalLocalSelfTest extends CacheTtlOnheapTransactionalAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.LOCAL;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+}
[22/23] incubator-ignite git commit: Merge branch 'ignite-sprint-3'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-593
Posted by ak...@apache.org.
Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-593
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0a815421
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0a815421
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0a815421
Branch: refs/heads/ignite-593
Commit: 0a81542167174ae803f1f9acda91434845b5012e
Parents: d36e301 09a3a82
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Apr 3 18:08:30 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Apr 3 18:08:30 2015 +0700
----------------------------------------------------------------------
modules/core/pom.xml | 38 +--
.../cache/CacheEvictableEntryImpl.java | 11 +-
.../processors/cache/CacheProjection.java | 36 ---
.../processors/cache/GridCacheAdapter.java | 257 +------------------
.../cache/GridCacheDeploymentManager.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 55 +---
.../processors/cache/GridCacheMapEntry.java | 232 +----------------
.../processors/cache/GridCachePeekMode.java | 81 ------
.../cache/GridCacheProjectionImpl.java | 11 -
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheUtils.java | 11 -
.../distributed/dht/GridDhtCacheAdapter.java | 9 +-
.../dht/atomic/GridDhtAtomicCache.java | 29 +--
.../dht/colocated/GridDhtColocatedCache.java | 30 +--
.../distributed/near/GridNearCacheAdapter.java | 72 +-----
.../distributed/near/GridNearTxRemote.java | 11 +-
.../cache/local/GridLocalCacheEntry.java | 1 -
.../processors/task/GridTaskProcessor.java | 9 +-
.../cache/VisorCacheDefaultConfiguration.java | 10 -
.../resources/META-INF/classnames.properties | 1 -
.../GridCachePreloadingEvictionsSelfTest.java | 4 +-
.../processors/cache/GridCacheTestEntryEx.java | 40 +--
...GridCacheDhtEvictionNearReadersSelfTest.java | 14 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 24 +-
.../dht/GridCacheDhtMappingSelfTest.java | 2 +-
.../near/GridCacheNearMultiNodeSelfTest.java | 103 +++-----
.../near/GridCacheNearOneNodeSelfTest.java | 33 +--
.../near/GridCacheNearReadersSelfTest.java | 154 +++++------
.../GridCacheReplicatedPreloadSelfTest.java | 11 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 3 +-
.../processors/igfs/IgfsSizeSelfTest.java | 46 +---
.../junits/common/GridCommonAbstractTest.java | 42 +++
.../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 3 +
.../cache/GridIndexingWithNoopSwapSelfTest.java | 2 +-
.../commands/cache/VisorCacheCommand.scala | 3 +-
35 files changed, 315 insertions(+), 1104 deletions(-)
----------------------------------------------------------------------
[13/23] incubator-ignite git commit: # ignite-670
Posted by ak...@apache.org.
# ignite-670
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f19a6119
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f19a6119
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f19a6119
Branch: refs/heads/ignite-593
Commit: f19a61191eaf41ef66870bfb3d7d90fe6f4aeda0
Parents: 34c29ed
Author: sboikov <se...@inria.fr>
Authored: Thu Apr 2 23:33:16 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Thu Apr 2 23:40:25 2015 +0300
----------------------------------------------------------------------
.../cache/ttl/CacheTtlAbstractSelfTest.java | 83 +++++++++++++++++---
1 file changed, 70 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f19a6119/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index 0e2e738..c56dfd4 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -36,7 +36,10 @@ import javax.cache.integration.*;
import java.util.*;
import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.cache.CachePeekMode.*;
+import static org.apache.ignite.cache.CacheRebalanceMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
/**
* TTL test.
@@ -58,17 +61,19 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- CacheConfiguration cache = new CacheConfiguration();
+ CacheConfiguration ccfg = new CacheConfiguration();
- cache.setCacheMode(cacheMode());
- cache.setAtomicityMode(atomicityMode());
- cache.setMemoryMode(memoryMode());
- cache.setOffHeapMaxMemory(0);
- cache.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
- cache.setIndexedTypes(Integer.class, Integer.class);
- cache.setBackups(2);
+ ccfg.setCacheMode(cacheMode());
+ ccfg.setAtomicityMode(atomicityMode());
+ ccfg.setMemoryMode(memoryMode());
+ ccfg.setOffHeapMaxMemory(0);
+ ccfg.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
+ ccfg.setIndexedTypes(Integer.class, Integer.class);
+ ccfg.setBackups(2);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+ ccfg.setRebalanceMode(SYNC);
- cache.setCacheStoreFactory(singletonFactory(new CacheStoreAdapter() {
+ ccfg.setCacheStoreFactory(singletonFactory(new CacheStoreAdapter() {
@Override public void loadCache(IgniteBiInClosure clo, Object... args) {
for (int i = 0; i < SIZE; i++)
clo.apply(i, i);
@@ -87,10 +92,10 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
}
}));
- cache.setExpiryPolicyFactory(
- FactoryBuilder.factoryOf(new TouchedExpiryPolicy(new Duration(MILLISECONDS, DEFAULT_TIME_TO_LIVE))));
+ ccfg.setExpiryPolicyFactory(
+ FactoryBuilder.factoryOf(new TouchedExpiryPolicy(new Duration(MILLISECONDS, DEFAULT_TIME_TO_LIVE))));
- cfg.setCacheConfiguration(cache);
+ cfg.setCacheConfiguration(ccfg);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
@@ -146,6 +151,16 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testDefaultTimeToLiveLoadAll() throws Exception {
+ defaultTimeToLiveLoadAll(false);
+
+ defaultTimeToLiveLoadAll(true);
+ }
+
+ /**
+ * @param replaceExisting Replace existing value flag.
+ * @throws Exception If failed.
+ */
+ private void defaultTimeToLiveLoadAll(boolean replaceExisting) throws Exception {
IgniteCache<Integer, Integer> cache = jcache(0);
CompletionListenerFuture fut = new CompletionListenerFuture();
@@ -155,7 +170,7 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
for (int i = 0; i < SIZE; ++i)
keys.add(i);
- cache.loadAll(keys, false, fut);
+ cache.loadAll(keys, replaceExisting, fut);
fut.get();
@@ -235,6 +250,31 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
+ public void testDefaultTimeToLivePreload() throws Exception {
+ if (cacheMode() == LOCAL)
+ return;
+
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ Map<Integer, Integer> entries = new HashMap<>();
+
+ for (int i = 0; i < SIZE; ++i)
+ entries.put(i, i);
+
+ cache.putAll(entries);
+
+ startGrid(gridCount());
+
+ checkSizeBeforeLive(SIZE, gridCount() + 1);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive(gridCount() + 1);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testTimeToLiveTtl() throws Exception {
long time = DEFAULT_TIME_TO_LIVE + 2000;
@@ -255,6 +295,10 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
checkSizeAfterLive();
}
+ /**
+ * @param size Expected size.
+ * @throws Exception If failed.
+ */
private void checkSizeBeforeLive(int size) throws Exception {
checkSizeBeforeLive(size, gridCount());
}
@@ -268,6 +312,11 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
for (int i = 0; i < gridCnt; ++i) {
IgniteCache<Integer, Integer> cache = jcache(i);
+ log.info("Size [node=" + i +
+ ", heap=" + cache.localSize(ONHEAP) +
+ ", offheap=" + cache.localSize(OFFHEAP) +
+ ", swap=" + cache.localSize(SWAP) + ']');
+
if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) {
assertEquals("Unexpected size, node: " + i, 0, cache.localSize(ONHEAP));
assertEquals("Unexpected size, node: " + i, size, cache.localSize(OFFHEAP));
@@ -280,6 +329,9 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
size > MAX_CACHE_SIZE ? size - MAX_CACHE_SIZE : 0, cache.localSize(OFFHEAP));
}
+ for (int key = 0; key < size; key++)
+ assertNotNull(cache.localPeek(key));
+
assertFalse(cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().isEmpty());
}
}
@@ -299,6 +351,11 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
for (int i = 0; i < gridCnt; ++i) {
IgniteCache<Integer, Integer> cache = jcache(i);
+ log.info("Size [node=" + i +
+ ", heap=" + cache.localSize(ONHEAP) +
+ ", offheap=" + cache.localSize(OFFHEAP) +
+ ", swap=" + cache.localSize(SWAP) + ']');
+
assertEquals(0, cache.localSize());
assertEquals(0, cache.localSize(OFFHEAP));
assertEquals(0, cache.localSize(SWAP));
[12/23] incubator-ignite git commit: # ignite-670 more tests,
use default expiry policy from isolated updater
Posted by ak...@apache.org.
# ignite-670 more tests, use default expiry policy from isolated updater
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/34c29ed7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/34c29ed7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/34c29ed7
Branch: refs/heads/ignite-593
Commit: 34c29ed74578bf569bf537a57f2db642e1d58d2a
Parents: f111294
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 2 16:24:01 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 2 16:24:01 2015 +0300
----------------------------------------------------------------------
.../datastreamer/DataStreamerImpl.java | 21 ++-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 175 +++++++++++++++----
2 files changed, 161 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/34c29ed7/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index 71a9364..2b470f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -43,6 +43,7 @@ import org.jetbrains.annotations.*;
import org.jsr166.*;
import javax.cache.*;
+import javax.cache.expiry.*;
import java.util.*;
import java.util.Map.*;
import java.util.concurrent.*;
@@ -1390,6 +1391,11 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
GridCacheVersion ver = cctx.versions().next(topVer);
+ long ttl = CU.TTL_ETERNAL;
+ long expiryTime = CU.EXPIRE_TIME_ETERNAL;
+
+ ExpiryPolicy plc = cctx.expiry();
+
for (Entry<KeyCacheObject, CacheObject> e : entries) {
try {
e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
@@ -1398,10 +1404,21 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
entry.unswap(false);
+ if (plc != null) {
+ ttl = CU.toTtl(plc.getExpiryForCreation());
+
+ if (ttl == CU.TTL_ZERO)
+ continue;
+ else if (ttl == CU.TTL_NOT_CHANGED)
+ ttl = 0;
+
+ expiryTime = CU.toExpireTime(ttl);
+ }
+
entry.initialValue(e.getValue(),
ver,
- CU.TTL_ETERNAL,
- CU.EXPIRE_TIME_ETERNAL,
+ ttl,
+ expiryTime,
false,
topVer,
GridDrType.DR_LOAD);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/34c29ed7/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index ebe6f16..0e2e738 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -21,17 +21,22 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.eviction.lru.*;
import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.junits.common.*;
+import javax.cache.*;
import javax.cache.configuration.*;
import javax.cache.expiry.*;
+import javax.cache.integration.*;
import java.util.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.cache.CachePeekMode.*;
/**
* TTL test.
@@ -61,17 +66,33 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
cache.setOffHeapMaxMemory(0);
cache.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
cache.setIndexedTypes(Integer.class, Integer.class);
+ cache.setBackups(2);
+
+ cache.setCacheStoreFactory(singletonFactory(new CacheStoreAdapter() {
+ @Override public void loadCache(IgniteBiInClosure clo, Object... args) {
+ for (int i = 0; i < SIZE; i++)
+ clo.apply(i, i);
+ }
+
+ @Override public Object load(Object key) throws CacheLoaderException {
+ return key;
+ }
+
+ @Override public void write(Cache.Entry entry) throws CacheWriterException {
+ // No-op.
+ }
+
+ @Override public void delete(Object key) throws CacheWriterException {
+ // No-op.
+ }
+ }));
cache.setExpiryPolicyFactory(
FactoryBuilder.factoryOf(new TouchedExpiryPolicy(new Duration(MILLISECONDS, DEFAULT_TIME_TO_LIVE))));
cfg.setCacheConfiguration(cache);
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(IP_FINDER);
-
- cfg.setDiscoverySpi(disco);
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
return cfg;
}
@@ -109,14 +130,82 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
+ public void testDefaultTimeToLiveLoadCache() throws Exception {
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ cache.loadCache(null);
+
+ checkSizeBeforeLive(SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDefaultTimeToLiveLoadAll() throws Exception {
+ IgniteCache<Integer, Integer> cache = jcache(0);
+
+ CompletionListenerFuture fut = new CompletionListenerFuture();
+
+ Set<Integer> keys = new HashSet<>();
+
+ for (int i = 0; i < SIZE; ++i)
+ keys.add(i);
+
+ cache.loadAll(keys, false, fut);
+
+ fut.get();
+
+ checkSizeBeforeLive(SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDefaultTimeToLiveStreamerAdd() throws Exception {
+ try (IgniteDataStreamer<Integer, Integer> streamer = ignite(0).dataStreamer(null)) {
+ for (int i = 0; i < SIZE; i++)
+ streamer.addData(i, i);
+ }
+
+ checkSizeBeforeLive(SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+
+ try (IgniteDataStreamer<Integer, Integer> streamer = ignite(0).dataStreamer(null)) {
+ streamer.allowOverwrite(true);
+
+ for (int i = 0; i < SIZE; i++)
+ streamer.addData(i, i);
+ }
+
+ checkSizeBeforeLive(SIZE);
+
+ Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+
+ checkSizeAfterLive();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testDefaultTimeToLivePut() throws Exception {
IgniteCache<Integer, Integer> cache = jcache(0);
- List<Integer> keys = primaryKeys(cache, 1);
+ Integer key = 0;
- cache.put(keys.get(0), 1);
+ cache.put(key, 1);
- checkSizeBeforeLive(cache, 1);
+ checkSizeBeforeLive(1);
Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
@@ -131,14 +220,12 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
Map<Integer, Integer> entries = new HashMap<>();
- List<Integer> keys = primaryKeys(cache, SIZE);
-
for (int i = 0; i < SIZE; ++i)
- entries.put(keys.get(i), i);
+ entries.put(i, i);
cache.putAll(entries);
- checkSizeBeforeLive(cache, SIZE);
+ checkSizeBeforeLive(SIZE);
Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
@@ -149,54 +236,76 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testTimeToLiveTtl() throws Exception {
- IgniteCache<Integer, Integer> cache = jcache(0);
-
long time = DEFAULT_TIME_TO_LIVE + 2000;
- List<Integer> keys = primaryKeys(cache, SIZE);
+ IgniteCache<Integer, Integer> cache = this.<Integer, Integer>jcache(0).withExpiryPolicy(
+ new TouchedExpiryPolicy(new Duration(MILLISECONDS, time)));
for (int i = 0; i < SIZE; i++)
- cache.withExpiryPolicy(new TouchedExpiryPolicy(new Duration(MILLISECONDS, time))).
- put(keys.get(i), i);
+ cache.put(i, i);
- checkSizeBeforeLive(cache, SIZE);
+ checkSizeBeforeLive(SIZE);
Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
- checkSizeBeforeLive(cache, SIZE);
+ checkSizeBeforeLive(SIZE);
Thread.sleep(time - DEFAULT_TIME_TO_LIVE + 500);
checkSizeAfterLive();
}
+ private void checkSizeBeforeLive(int size) throws Exception {
+ checkSizeBeforeLive(size, gridCount());
+ }
+
/**
+ * @param size Expected size.
+ * @param gridCnt Number of nodes.
* @throws Exception If failed.
*/
- private void checkSizeBeforeLive(IgniteCache<Integer, Integer> cache, int size) throws Exception {
- if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) {
- assertEquals(0, cache.localSize(CachePeekMode.ONHEAP));
- assertEquals(size, cache.localSize(CachePeekMode.OFFHEAP));
- }
- else {
- assertEquals(size > MAX_CACHE_SIZE ? MAX_CACHE_SIZE : size, cache.localSize(CachePeekMode.ONHEAP));
- assertEquals(size > MAX_CACHE_SIZE ? size - MAX_CACHE_SIZE : 0, cache.localSize(CachePeekMode.OFFHEAP));
- }
+ private void checkSizeBeforeLive(int size, int gridCnt) throws Exception {
+ for (int i = 0; i < gridCnt; ++i) {
+ IgniteCache<Integer, Integer> cache = jcache(i);
+
+ if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) {
+ assertEquals("Unexpected size, node: " + i, 0, cache.localSize(ONHEAP));
+ assertEquals("Unexpected size, node: " + i, size, cache.localSize(OFFHEAP));
+ }
+ else {
+ assertEquals("Unexpected size, node: " + i, size > MAX_CACHE_SIZE ? MAX_CACHE_SIZE : size,
+ cache.localSize(ONHEAP));
- assertFalse(cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().isEmpty());
+ assertEquals("Unexpected size, node: " + i,
+ size > MAX_CACHE_SIZE ? size - MAX_CACHE_SIZE : 0, cache.localSize(OFFHEAP));
+ }
+
+ assertFalse(cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().isEmpty());
+ }
}
/**
* @throws Exception If failed.
*/
private void checkSizeAfterLive() throws Exception {
- for (int i = 0; i < gridCount(); ++i) {
+ checkSizeAfterLive(gridCount());
+ }
+
+ /**
+ * @param gridCnt Number of nodes.
+ * @throws Exception If failed.
+ */
+ private void checkSizeAfterLive(int gridCnt) throws Exception {
+ for (int i = 0; i < gridCnt; ++i) {
IgniteCache<Integer, Integer> cache = jcache(i);
assertEquals(0, cache.localSize());
- assertEquals(0, cache.localSize(CachePeekMode.OFFHEAP));
- assertEquals(0, cache.localSize(CachePeekMode.SWAP));
+ assertEquals(0, cache.localSize(OFFHEAP));
+ assertEquals(0, cache.localSize(SWAP));
assertEquals(0, cache.query(new SqlQuery<>(Integer.class, "_val >= 0")).getAll().size());
+
+ for (int key = 0; key < SIZE; key++)
+ assertNull(cache.localPeek(key));
}
}
}
[15/23] incubator-ignite git commit: Merge branches 'ignite-593' and
'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-593
Posted by ak...@apache.org.
Merge branches 'ignite-593' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-593
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d36e301c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d36e301c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d36e301c
Branch: refs/heads/ignite-593
Commit: d36e301c4566d5a231b95046c7c8098f9a05d974
Parents: 44b1bb2 6c3f101
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Apr 3 14:19:25 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Apr 3 14:19:25 2015 +0700
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 29 --
.../processors/cache/GridCacheAdapter.java | 3 +-
.../processors/cache/GridCacheAttributes.java | 8 -
.../cache/GridCacheConcurrentMap.java | 34 +-
.../processors/cache/GridCacheMapEntry.java | 28 +-
.../cache/GridCacheMapEntryFactory.java | 2 -
.../processors/cache/GridCacheProcessor.java | 3 -
.../distributed/GridDistributedCacheEntry.java | 4 +-
.../distributed/dht/GridDhtCacheAdapter.java | 16 +-
.../distributed/dht/GridDhtCacheEntry.java | 4 +-
.../distributed/dht/GridNoStorageCacheMap.java | 11 +-
.../dht/atomic/GridDhtAtomicCache.java | 3 +-
.../dht/atomic/GridDhtAtomicCacheEntry.java | 4 +-
.../dht/colocated/GridDhtColocatedCache.java | 5 +-
.../colocated/GridDhtColocatedCacheEntry.java | 4 +-
.../colocated/GridDhtDetachedCacheEntry.java | 5 +-
.../distributed/near/GridNearCacheAdapter.java | 3 +-
.../distributed/near/GridNearCacheEntry.java | 4 +-
.../processors/cache/local/GridLocalCache.java | 3 +-
.../cache/local/GridLocalCacheEntry.java | 3 +-
.../local/atomic/GridLocalAtomicCache.java | 3 +-
.../datastreamer/DataStreamerImpl.java | 21 +-
.../cache/VisorCacheDefaultConfiguration.java | 11 -
...idCacheConfigurationConsistencySelfTest.java | 3 -
.../GridCacheDhtEvictionsDisabledSelfTest.java | 8 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 2 +-
.../loadtests/hashmap/GridHashMapLoadTest.java | 2 +-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 368 +++++++++++++++++++
.../ttl/CacheTtlOffheapAbstractSelfTest.java | 29 ++
.../CacheTtlOffheapAtomicAbstractSelfTest.java | 29 ++
.../ttl/CacheTtlOffheapAtomicLocalSelfTest.java | 34 ++
...acheTtlOffheapAtomicPartitionedSelfTest.java | 34 ++
...TtlOffheapTransactionalAbstractSelfTest.java | 29 ++
...cheTtlOffheapTransactionalLocalSelfTest.java | 34 ++
...OffheapTransactionalPartitionedSelfTest.java | 34 ++
.../ttl/CacheTtlOnheapAbstractSelfTest.java | 29 ++
.../CacheTtlOnheapAtomicAbstractSelfTest.java | 29 ++
.../ttl/CacheTtlOnheapAtomicLocalSelfTest.java | 34 ++
...CacheTtlOnheapAtomicPartitionedSelfTest.java | 34 ++
...eTtlOnheapTransactionalAbstractSelfTest.java | 29 ++
...acheTtlOnheapTransactionalLocalSelfTest.java | 34 ++
...lOnheapTransactionalPartitionedSelfTest.java | 34 ++
.../IgniteCacheWithIndexingTestSuite.java | 51 +++
.../IgniteH2IndexingSpiTestSuite.java | 7 -
.../commands/cache/VisorCacheCommand.scala | 1 -
45 files changed, 950 insertions(+), 149 deletions(-)
----------------------------------------------------------------------
[09/23] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-3' into ignite-gg-10009-2
Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-gg-10009-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f1112946
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f1112946
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f1112946
Branch: refs/heads/ignite-593
Commit: f111294648e856b6a68c78cdf753a50e81d800f5
Parents: 93912fe 214a461
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 2 15:23:42 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 2 15:23:42 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 2 +
examples/pom.xml | 19 +-
examples/schema-import/pom.xml | 10 +-
ipc/shmem/README.txt | 2 +-
modules/aop/pom.xml | 6 +-
modules/aws/pom.xml | 4 +-
modules/clients/pom.xml | 10 +-
modules/codegen/pom.xml | 4 +-
modules/core/pom.xml | 8 +-
.../apache/ignite/cache/CachingProvider.java | 2 +-
.../processors/cache/CacheObjectContext.java | 14 +-
.../processors/cache/CacheObjectImpl.java | 10 +-
.../processors/cache/GridCacheMapEntry.java | 2 +-
.../cache/query/GridCacheQueryManager.java | 16 +-
.../transactions/IgniteTxLocalAdapter.java | 4 +-
.../IgniteCacheObjectProcessorImpl.java | 173 +++++++----
.../visor/cache/VisorCacheConfiguration.java | 81 ++---
.../cache/VisorCacheNearConfiguration.java | 11 +-
.../visor/node/VisorGridConfiguration.java | 28 +-
.../internal/visor/util/VisorMimeTypes.java | 4 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 9 +-
.../resources/META-INF/classnames.properties | 79 ++---
.../ignite/IgniteCacheAffinitySelfTest.java | 2 +
.../GridCacheOnCopyFlagAbstractSelfTest.java | 16 +-
.../IgniteCacheAtomicLocalStoreValueTest.java | 49 +++
...iteCacheAtomicNearEnabledStoreValueTest.java | 30 ++
...maryWriteOrderNearEnabledStoreValueTest.java | 31 ++
...heAtomicPrimaryWriteOrderStoreValueTest.java | 32 ++
.../cache/IgniteCacheAtomicStoreValueTest.java | 55 ++++
.../IgniteCacheStoreValueAbstractTest.java | 311 +++++++++++++++++++
.../cache/IgniteCacheTxLocalStoreValueTest.java | 49 +++
.../IgniteCacheTxNearEnabledStoreValueTest.java | 30 ++
.../cache/IgniteCacheTxStoreValueTest.java | 49 +++
.../processors/igfs/IgsfStartCacheTest.java | 115 +++++++
.../junits/common/GridCommonAbstractTest.java | 2 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 9 +
modules/extdata/p2p/pom.xml | 4 +-
modules/extdata/uri/pom.xml | 4 +-
modules/geospatial/pom.xml | 4 +-
modules/hadoop/pom.xml | 8 +-
modules/hibernate/pom.xml | 6 +-
modules/indexing/pom.xml | 4 +-
modules/jcl/pom.xml | 4 +-
modules/jta/pom.xml | 4 +-
modules/log4j/pom.xml | 4 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 10 +-
modules/schedule/pom.xml | 4 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 8 +-
modules/ssh/pom.xml | 8 +-
modules/urideploy/pom.xml | 6 +-
.../GridUriDeploymentFileResourceLoader.java | 2 +-
modules/visor-console/pom.xml | 8 +-
.../scala/org/apache/ignite/visor/visor.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 8 +-
modules/yardstick/pom.xml | 6 +-
parent/pom.xml | 10 +-
pom.xml | 56 ++--
61 files changed, 1138 insertions(+), 318 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f1112946/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
[14/23] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-670' into ignite-sprint-3
Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-670' into ignite-sprint-3
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6c3f1013
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6c3f1013
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6c3f1013
Branch: refs/heads/ignite-593
Commit: 6c3f1013a5dc981ee139668369ae75a427ebc49a
Parents: b10fdc7 f19a611
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 08:59:57 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 08:59:57 2015 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 29 --
.../processors/cache/GridCacheAdapter.java | 3 +-
.../processors/cache/GridCacheAttributes.java | 8 -
.../cache/GridCacheConcurrentMap.java | 34 +-
.../processors/cache/GridCacheMapEntry.java | 28 +-
.../cache/GridCacheMapEntryFactory.java | 2 -
.../processors/cache/GridCacheProcessor.java | 3 -
.../distributed/GridDistributedCacheEntry.java | 4 +-
.../distributed/dht/GridDhtCacheAdapter.java | 16 +-
.../distributed/dht/GridDhtCacheEntry.java | 4 +-
.../distributed/dht/GridNoStorageCacheMap.java | 11 +-
.../dht/atomic/GridDhtAtomicCache.java | 3 +-
.../dht/atomic/GridDhtAtomicCacheEntry.java | 4 +-
.../dht/colocated/GridDhtColocatedCache.java | 5 +-
.../colocated/GridDhtColocatedCacheEntry.java | 4 +-
.../colocated/GridDhtDetachedCacheEntry.java | 5 +-
.../distributed/near/GridNearCacheAdapter.java | 3 +-
.../distributed/near/GridNearCacheEntry.java | 4 +-
.../processors/cache/local/GridLocalCache.java | 3 +-
.../cache/local/GridLocalCacheEntry.java | 3 +-
.../local/atomic/GridLocalAtomicCache.java | 3 +-
.../datastreamer/DataStreamerImpl.java | 21 +-
.../cache/VisorCacheDefaultConfiguration.java | 11 -
...idCacheConfigurationConsistencySelfTest.java | 3 -
.../GridCacheDhtEvictionsDisabledSelfTest.java | 8 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 2 +-
.../loadtests/hashmap/GridHashMapLoadTest.java | 2 +-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 368 +++++++++++++++++++
.../ttl/CacheTtlOffheapAbstractSelfTest.java | 29 ++
.../CacheTtlOffheapAtomicAbstractSelfTest.java | 29 ++
.../ttl/CacheTtlOffheapAtomicLocalSelfTest.java | 34 ++
...acheTtlOffheapAtomicPartitionedSelfTest.java | 34 ++
...TtlOffheapTransactionalAbstractSelfTest.java | 29 ++
...cheTtlOffheapTransactionalLocalSelfTest.java | 34 ++
...OffheapTransactionalPartitionedSelfTest.java | 34 ++
.../ttl/CacheTtlOnheapAbstractSelfTest.java | 29 ++
.../CacheTtlOnheapAtomicAbstractSelfTest.java | 29 ++
.../ttl/CacheTtlOnheapAtomicLocalSelfTest.java | 34 ++
...CacheTtlOnheapAtomicPartitionedSelfTest.java | 34 ++
...eTtlOnheapTransactionalAbstractSelfTest.java | 29 ++
...acheTtlOnheapTransactionalLocalSelfTest.java | 34 ++
...lOnheapTransactionalPartitionedSelfTest.java | 34 ++
.../IgniteCacheWithIndexingTestSuite.java | 51 +++
.../IgniteH2IndexingSpiTestSuite.java | 7 -
.../commands/cache/VisorCacheCommand.scala | 1 -
45 files changed, 950 insertions(+), 149 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c3f1013/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
[20/23] incubator-ignite git commit: Merge branch 'ignite-sprint-3'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-sprint-3
Posted by ak...@apache.org.
Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-3
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/adba7eba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/adba7eba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/adba7eba
Branch: refs/heads/ignite-593
Commit: adba7eba7c417b9aa29ec8f731712546721a2c7d
Parents: 7cb512a c4611b8
Author: Andrey Gura <ag...@gridgain.com>
Authored: Fri Apr 3 12:17:08 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Fri Apr 3 12:17:08 2015 +0300
----------------------------------------------------------------------
.../ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
[10/23] incubator-ignite git commit: ignite-645 review fixes
Posted by ak...@apache.org.
ignite-645 review fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/07ed759a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/07ed759a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/07ed759a
Branch: refs/heads/ignite-593
Commit: 07ed759a89d49e35ec0ef3122e69e094af666f8c
Parents: ef095dc
Author: Andrey Gura <ag...@gridgain.com>
Authored: Thu Apr 2 15:25:24 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Thu Apr 2 15:25:24 2015 +0300
----------------------------------------------------------------------
.../distributed/near/GridNearCacheAdapter.java | 24 --------
.../near/GridCacheNearMultiNodeSelfTest.java | 31 +++++-----
.../near/GridCacheNearOneNodeSelfTest.java | 8 +--
.../near/GridCacheNearReadersSelfTest.java | 62 ++++++++++----------
4 files changed, 49 insertions(+), 76 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07ed759a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index b08a49b..e05ec2e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -419,15 +419,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
return super.evict(key, filter) & dht().evict(key, filter);
}
- /**
- * @param key Key to evict.
- * @param filter Optional filter.
- * @return {@code True} if evicted.
- */
- public boolean evictNearOnly(K key, @Nullable CacheEntryPredicate[] filter) {
- return super.evict(key, filter);
- }
-
/** {@inheritDoc} */
@Override public void evictAll(Collection<? extends K> keys,
@Nullable CacheEntryPredicate[] filter) {
@@ -448,21 +439,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
}
}
- /**
- * Peeks only near cache without looking into DHT cache.
- *
- * @param key Key.
- * @return Peeked value.
- */
- @Nullable public V peekNearOnly(K key) {
- try {
- return localPeek(key, CachePeekModes.ONHEAP_ONLY, null);
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
-
/** {@inheritDoc} */
@Override public boolean clearLocally0(K key, @Nullable CacheEntryPredicate[] filter) {
return super.clearLocally0(key, filter) | dht().clearLocally0(key, filter);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07ed759a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
index 8a9816d..548564a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
@@ -585,14 +585,11 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
cache.put(key, val);
- GridNearCacheAdapter<Integer, String> near0 = near(0);
- GridNearCacheAdapter<Integer, String> near1 = near(1);
-
GridDhtCacheAdapter<Integer, String> dht0 = dht(0);
GridDhtCacheAdapter<Integer, String> dht1 = dht(1);
- assertNull(near0.peekNearOnly(key));
- assertNull(near1.peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
assertEquals(val, localPeek(dht0, key));
assertEquals(val, localPeek(dht1, key));
@@ -690,8 +687,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertNotNull(nearEntry3);
assertTrue("Invalid near entry: " + nearEntry3, nearEntry3.valid(topVer));
- assertNotNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNotNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
assertEquals(val, cache.get(key));
assertEquals(val, cache.getAndRemove(key));
@@ -706,8 +703,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
lock.unlock();
}
- assertNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
assertFalse(near(0).isLockedNearOnly(key));
assertFalse(cache.isLocalLocked(key, true));
@@ -804,8 +801,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals(val, dhtPeek(0, key));
assertEquals(val, dhtPeek(1, key));
- assertNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
if (transactional()) {
@@ -822,8 +819,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals(val, dhtPeek(0, key));
assertEquals(val, dhtPeek(1, key));
- assertNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
}
/** @throws Exception If failed. */
@@ -850,8 +847,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals(val, dhtPeek(0, key));
assertEquals(val, dhtPeek(1, key));
- assertNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
if (transactional()) {
try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
@@ -875,8 +872,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertNull(dhtPeek(0, key));
assertNull(dhtPeek(1, key));
- assertNull(near(0).peekNearOnly(key));
- assertNull(near(1).peekNearOnly(key));
+ assertNull(near(0).peekEx(key));
+ assertNull(near(1).peekEx(key));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07ed759a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
index 3cc4e01..d73c8ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
@@ -283,7 +283,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
cache.put(1, "val1");
assertEquals("val1", dhtPeek(1));
- assertNull(near().peekNearOnly(1));
+ assertNull(near().peekEx(1));
Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -292,7 +292,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
tx.commit();
assertEquals("val1", dhtPeek(1));
- assertNull(near().peekNearOnly(1));
+ assertNull(near().peekEx(1));
}
/** @throws Exception If failed. */
@@ -302,7 +302,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
cache.put(1, "val1");
assertEquals("val1", dhtPeek(1));
- assertNull(near().peekNearOnly(1));
+ assertNull(near().peekEx(1));
Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -313,7 +313,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
tx.commit();
assertNull(dhtPeek(1));
- assertNull(near().peekNearOnly(1));
+ assertNull(near().peekEx(1));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07ed759a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
index a0d9f03..59378bb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
@@ -245,8 +245,8 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals("v1", dhtPeek(cache1, 1));
assertEquals("v1", dhtPeek(cache2, 1));
- assertNull(near(cache1).peekNearOnly(1));
- assertNull(near(cache2).peekNearOnly(1));
+ assertNull(near(cache1).peekEx(1));
+ assertNull(near(cache2).peekEx(1));
GridDhtCacheEntry e1 = (GridDhtCacheEntry)dht(cache1).entryEx(1);
@@ -261,8 +261,8 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals("v2", dhtPeek(cache1, 2));
assertEquals("v2", dhtPeek(cache2, 2));
- assertNull(near(cache1).peekNearOnly(2));
- assertNull(near(cache2).peekNearOnly(2));
+ assertNull(near(cache1).peekEx(2));
+ assertNull(near(cache2).peekEx(2));
GridDhtCacheEntry c2e2 = (GridDhtCacheEntry)dht(cache2).entryEx(2);
@@ -274,7 +274,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals("v1", cache2.get(1));
// Since DHT cache2 has the value, Near cache2 should not have it.
- assertNull(near(cache2).peekNearOnly(1));
+ assertNull(near(cache2).peekEx(1));
// Since v1 was retrieved locally from cache2, cache1 should not know about it.
assertFalse(e1.readers().contains(n2.id()));
@@ -283,7 +283,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
// It should not be successful since it's not allowed to evict entry on backup node.
cache2.localEvict(Collections.singleton(1));
- assertNull(near(cache2).peekNearOnly(1));
+ assertNull(near(cache2).peekEx(1));
assertEquals("v1", dhtPeek(cache2, 1));
assertEquals("v1", cache1.getAndPut(1, "z1"));
@@ -291,7 +291,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
// Node 1 should not have node2 in readers map.
assertFalse(e1.readers().contains(n2.id()));
- assertNull(near(cache2).peekNearOnly(1));
+ assertNull(near(cache2).peekEx(1));
assertEquals("z1", dhtPeek(cache2, 1));
}
@@ -447,9 +447,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals(val1, dhtPeek(1, key1));
assertNull(dhtPeek(2, key1));
- assertNull(near(0).peekNearOnly(key1));
- assertNull(near(1).peekNearOnly(key1));
- assertNull(near(2).peekNearOnly(key1));
+ assertNull(near(0).peekEx(key1));
+ assertNull(near(1).peekEx(key1));
+ assertNull(near(2).peekEx(key1));
cache.put(key2, val2);
@@ -457,9 +457,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals(val2, dhtPeek(1, key2));
assertEquals(val2, dhtPeek(2, key2));
- assertEquals(val2, near(0).peekNearOnly(key2));
- assertNull(near(1).peekNearOnly(key2));
- assertNull(near(2).peekNearOnly(key2));
+ assertEquals(val2, near(0).peekEx(key2).wrap().getValue());
+ assertNull(near(1).peekEx(key2));
+ assertNull(near(2).peekEx(key2));
String val22 = val2 + "2";
@@ -469,9 +469,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals(val22, dhtPeek(1, key2));
assertEquals(val22, dhtPeek(2, key2));
- assertEquals(val22, near(0).peekNearOnly(key2));
- assertNull(near(1).peekNearOnly(key2));
- assertNull(near(2).peekNearOnly(key2));
+ assertEquals(val22, near(0).peekEx(key2).wrap().getValue());
+ assertNull(near(1).peekEx(key2));
+ assertNull(near(2).peekEx(key2));
cache.remove(key2);
@@ -479,9 +479,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertNull(dhtPeek(1, key2));
assertNull(dhtPeek(2, key2));
- assertNull(near(0).peekNearOnly(key2));
- assertNull(near(1).peekNearOnly(key2));
- assertNull(near(2).peekNearOnly(key2));
+ assertNull(near(0).peekEx(key2));
+ assertNull(near(1).peekEx(key2));
+ assertNull(near(2).peekEx(key2));
cache.remove(key1);
@@ -489,9 +489,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertNull(dhtPeek(1, key1));
assertNull(dhtPeek(2, key1));
- assertNull(near(0).peekNearOnly(key1));
- assertNull(near(1).peekNearOnly(key1));
- assertNull(near(2).peekNearOnly(key1));
+ assertNull(near(0).peekEx(key1));
+ assertNull(near(1).peekEx(key1));
+ assertNull(near(2).peekEx(key1));
for (int i = 0; i < grids; i++) {
assert !jcache(i).isLocalLocked(key1, false);
@@ -542,10 +542,10 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
// Since near entry holds the lock, it should
// contain correct value.
- assertEquals(val1, near(0).peekNearOnly(key1));
+ assertEquals(val1, near(0).peekEx(key1).wrap().getValue());
- assertNull(near(1).peekNearOnly(key1));
- assertNull(near(2).peekNearOnly(key1));
+ assertNull(near(1).peekEx(key1));
+ assertNull(near(2).peekEx(key1));
cache.put(key2, val2);
@@ -553,9 +553,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals(val2, dhtPeek(1, key2));
assertEquals(val2, dhtPeek(2, key2));
- assertEquals(val2, near(0).peekNearOnly(key2));
- assertNull(near(1).peekNearOnly(key2));
- assertNull(near(2).peekNearOnly(key2));
+ assertEquals(val2, near(0).peekEx(key2).wrap().getValue());
+ assertNull(near(1).peekEx(key2));
+ assertNull(near(2).peekEx(key2));
String val22 = val2 + "2";
@@ -565,9 +565,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
assertEquals(val22, dhtPeek(1, key2));
assertEquals(val22, dhtPeek(2, key2));
- assertEquals(val22, near(0).peekNearOnly(key2));
- assertNull(near(1).peekNearOnly(key2));
- assertNull(near(2).peekNearOnly(key2));
+ assertEquals(val22, near(0).peekEx(key2).wrap().getValue());
+ assertNull(near(1).peekEx(key2));
+ assertNull(near(2).peekEx(key2));
cache.remove(key2);
[06/23] incubator-ignite git commit: # ignite-645 review
Posted by ak...@apache.org.
# ignite-645 review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/282e8a57
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/282e8a57
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/282e8a57
Branch: refs/heads/ignite-593
Commit: 282e8a5717722eafeec0bb7abb5b2e75f8399f9e
Parents: 7f69f2a
Author: sboikov <se...@inria.fr>
Authored: Wed Apr 1 23:25:08 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Wed Apr 1 23:25:08 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheEntryEx.java | 8 ++++----
.../processors/cache/GridCacheMapEntry.java | 13 -------------
.../cache/distributed/dht/GridDhtCacheAdapter.java | 6 +++---
.../distributed/dht/atomic/GridDhtAtomicCache.java | 6 +++---
.../dht/colocated/GridDhtColocatedCache.java | 17 +++++++++--------
.../distributed/near/GridNearCacheAdapter.java | 14 ++++++--------
.../processors/task/GridTaskProcessor.java | 2 +-
7 files changed, 26 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index adeb95b..c0f1d35 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -580,10 +580,10 @@ public interface GridCacheEntryEx {
/**
* Peeks into entry without loading value or updating statistics.
*
- * @param heap Heap.
- * @param offheap Offheap.
- * @param swap Swap.
- * @param plc Policy.
+ * @param heap Read from heap flag.
+ * @param offheap Read from offheap flag.
+ * @param swap Read from swap flag.
+ * @param plc Expiry policy if TTL should be updated.
* @return Value.
* @throws GridCacheEntryRemovedException If entry has been removed.
* @throws IgniteCheckedException If failed.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 5bc255f..45fbced 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2857,19 +2857,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
/**
* @param failFast Fail fast flag.
- * @param filter Filter.
- * @param tx Transaction to peek value at (if mode is TX value).
- * @return Peeked value.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @Nullable private GridTuple<CacheObject> peekTx(boolean failFast,
- CacheEntryPredicate[] filter,
- @Nullable IgniteInternalTx tx) throws GridCacheFilterFailedException {
- return tx == null ? null : tx.peek(cctx, failFast, key, filter);
- }
-
- /**
- * @param failFast Fail fast flag.
* @param topVer Topology version.
* @param filter Filter.
* @param expiryPlc Optional expiry policy.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 475fea6..c9a23b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
@@ -877,8 +876,9 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
try {
return partId == ctx.affinity().partition(entry.getKey()) &&
- F.eq(entry.getValue(), localPeek(entry.getKey(), new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
- } catch (IgniteCheckedException e) {
+ F.eq(entry.getValue(), localPeek(entry.getKey(), CachePeekModes.ONHEAP_ONLY, null));
+ }
+ catch (IgniteCheckedException e) {
throw new IgniteException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 2d7f58f..b8639d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
@@ -254,8 +253,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
try {
- return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
- } catch (IgniteCheckedException e) {
+ return new CacheEntryImpl<>(key, localPeek(key, CachePeekModes.ONHEAP_ONLY, null));
+ }
+ catch (IgniteCheckedException e) {
throw new IgniteException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 8d4f153..0782a37 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -80,13 +80,14 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
map.setEntryFactory(new GridCacheMapEntryFactory() {
/** {@inheritDoc} */
@Override public GridCacheMapEntry create(GridCacheContext ctx,
- AffinityTopologyVersion topVer,
- KeyCacheObject key,
- int hash,
- CacheObject val,
- GridCacheMapEntry next,
- long ttl,
- int hdrId) {
+ AffinityTopologyVersion topVer,
+ KeyCacheObject key,
+ int hash,
+ CacheObject val,
+ GridCacheMapEntry next,
+ long ttl,
+ int hdrId)
+ {
return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, val, next, ttl, hdrId);
}
});
@@ -389,7 +390,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
/** {@inheritDoc} */
@Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
try {
- return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+ return new CacheEntryImpl<>(key, localPeek(key, CachePeekModes.ONHEAP_ONLY, null));
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 241af05..b08a49b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -441,8 +441,9 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
// We don't try wrap entry from near or dht cache.
// Created object will be wrapped once some method is called.
try {
- return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
- } catch (IgniteCheckedException e) {
+ return new CacheEntryImpl<>(key, localPeek(key, CachePeekModes.ONHEAP_ONLY, null));
+ }
+ catch (IgniteCheckedException e) {
throw new IgniteException(e);
}
}
@@ -455,13 +456,10 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
*/
@Nullable public V peekNearOnly(K key) {
try {
- return localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
+ return localPeek(key, CachePeekModes.ONHEAP_ONLY, null);
}
- catch (IgniteCheckedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Filter validation failed for key: " + key);
-
- return null;
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/282e8a57/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index 4add987..274310e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -346,7 +346,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
try {
return tasksMetaCache.localPeek(
- new GridTaskNameHashKey(taskNameHash), new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
+ new GridTaskNameHashKey(taskNameHash), CachePeekModes.ONHEAP_ONLY, null);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
[02/23] incubator-ignite git commit: ignite-645 Remove
GridCachePeekMode
Posted by ak...@apache.org.
ignite-645 Remove GridCachePeekMode
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dfb4679f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dfb4679f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dfb4679f
Branch: refs/heads/ignite-593
Commit: dfb4679f912eb226b04c20b29e6e2d6872e95b9f
Parents: 35d05e9
Author: Andrey Gura <ag...@gridgain.com>
Authored: Mon Mar 30 21:57:29 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Wed Apr 1 11:55:02 2015 +0300
----------------------------------------------------------------------
.../cache/CacheEvictableEntryImpl.java | 11 +-
.../processors/cache/CacheProjection.java | 36 ---
.../processors/cache/GridCacheAdapter.java | 257 +------------------
.../cache/GridCacheDeploymentManager.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 42 +--
.../processors/cache/GridCacheMapEntry.java | 183 +------------
.../processors/cache/GridCachePeekMode.java | 81 ------
.../cache/GridCacheProjectionImpl.java | 11 -
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheUtils.java | 11 -
.../distributed/dht/GridDhtCacheAdapter.java | 9 +-
.../dht/atomic/GridDhtAtomicCache.java | 29 +--
.../dht/colocated/GridDhtColocatedCache.java | 45 +---
.../distributed/near/GridNearCacheAdapter.java | 54 +---
.../distributed/near/GridNearTxRemote.java | 11 +-
.../processors/task/GridTaskProcessor.java | 9 +-
.../resources/META-INF/classnames.properties | 1 -
.../GridCachePreloadingEvictionsSelfTest.java | 4 +-
.../processors/cache/GridCacheTestEntryEx.java | 31 +--
...GridCacheDhtEvictionNearReadersSelfTest.java | 14 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 24 +-
.../dht/GridCacheDhtMappingSelfTest.java | 2 +-
.../near/GridCacheNearMultiNodeSelfTest.java | 72 ++----
.../near/GridCacheNearOneNodeSelfTest.java | 25 +-
.../near/GridCacheNearReadersSelfTest.java | 92 +++----
.../GridCacheReplicatedPreloadSelfTest.java | 11 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 3 +-
.../processors/igfs/IgfsSizeSelfTest.java | 46 +---
.../junits/common/GridCommonAbstractTest.java | 42 +++
.../cache/GridIndexingWithNoopSwapSelfTest.java | 2 +-
30 files changed, 253 insertions(+), 936 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
index 6144807..5d6062e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
@@ -76,16 +76,18 @@ public class CacheEvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
/**
* @return Peeks value.
*/
- @SuppressWarnings("unchecked")
@Nullable public V peek() {
try {
- CacheObject val = cached.peek(GridCachePeekMode.GLOBAL);
+ CacheObject val = cached.peek(true, false, false, null);
return val != null ? val.<V>value(cached.context().cacheObjectContext(), false) : null;
}
catch (GridCacheEntryRemovedException e) {
return null;
}
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/** {@inheritDoc} */
@@ -114,13 +116,16 @@ public class CacheEvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
return null;
try {
- CacheObject val = e.peek(GridCachePeekMode.GLOBAL, CU.empty0());
+ CacheObject val = e.peek(true, false, false, null);
return val != null ? val.<V>value(cached.context().cacheObjectContext(), false) : null;
}
catch (GridCacheEntryRemovedException ignored) {
// No-op.
}
+ catch (IgniteCheckedException ex) {
+ throw new IgniteException(ex);
+ }
}
}
catch (GridCacheFilterFailedException ignored) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 0ff316d..b17fdac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -336,23 +336,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> {
public IgniteInternalFuture<V> reloadAsync(K key);
/**
- * Peeks at in-memory cached value using default {@link GridCachePeekMode#SMART}
- * peek mode.
- * <p>
- * This method will not load value from any persistent store or from a remote node.
- * <h2 class="header">Transactions</h2>
- * This method does not participate in any transactions, however, it will
- * peek at transactional value according to the {@link GridCachePeekMode#SMART} mode
- * semantics. If you need to look at global cached value even from within transaction,
- * you can use {@link GridCache#peek(Object, Collection)} method.
- *
- * @param key Entry key.
- * @return Peeked value.
- * @throws NullPointerException If key is {@code null}.
- */
- @Nullable public V peek(K key);
-
- /**
* @param key Key.
* @param peekModes Peek modes.
* @param plc Expiry policy if TTL should be updated.
@@ -370,25 +353,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> {
public Iterable<Cache.Entry<K, V>> localEntries(CachePeekMode[] peekModes) throws IgniteCheckedException;
/**
- * Peeks at cached value using optional set of peek modes. This method will sequentially
- * iterate over given peek modes in the order passed in, and try to peek at value using
- * each peek mode. Once a {@code non-null} value is found, it will be immediately returned.
- * <p>
- * Note that if modes are not provided this method works exactly the same way as
- * {@link #peek(Object)}, implicitly using {@link GridCachePeekMode#SMART} mode.
- * <h2 class="header">Transactions</h2>
- * This method does not participate in any transactions, however, it may
- * peek at transactional value depending on the peek modes used.
- *
- * @param key Entry key.
- * @param modes Optional set of peek modes.
- * @return Peeked value.
- * @throws IgniteCheckedException If peek operation failed.
- * @throws NullPointerException If key is {@code null}.
- */
- @Nullable public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException;
-
- /**
* Retrieves value mapped to the specified key from cache. Value will only be returned if
* its entry passed the optional filter provided. Filter check is atomic, and therefore the
* returned value is guaranteed to be consistent with the filter. The return value of {@code null}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 02429b3..e749af7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -59,11 +59,9 @@ import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.locks.*;
-import static java.util.Collections.*;
import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.internal.GridClosureCallMode.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
import static org.apache.ignite.internal.processors.dr.GridDrType.*;
import static org.apache.ignite.internal.processors.task.GridTaskThreadContextKey.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
@@ -820,219 +818,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
return null;
}
- /** {@inheritDoc} */
- @Override public V peek(K key) {
- return peek(key, (CacheEntryPredicate)null);
- }
-
- /** {@inheritDoc} */
- @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- return peek0(key, modes, ctx.tm().localTxx());
- }
-
- /**
- * @param failFast Fail fast flag.
- * @param key Key.
- * @param mode Peek mode.
- * @param filter Filter.
- * @return Peeked value.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @Nullable protected GridTuple<V> peek0(boolean failFast, K key, GridCachePeekMode mode,
- @Nullable CacheEntryPredicate... filter) throws GridCacheFilterFailedException {
- A.notNull(key, "key");
-
- if (keyCheck)
- validateCacheKey(key);
-
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
-
- GridCacheEntryEx e = null;
-
- try {
- KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
-
- e = peekEx(cacheKey);
-
- if (e != null) {
- GridTuple<CacheObject> peek = e.peek0(failFast, mode, filter, ctx.tm().localTxx());
-
- if (peek != null) {
- CacheObject v = peek.get();
-
- Object val0 = CU.value(v, ctx, true);
-
- val0 = ctx.unwrapPortableIfNeeded(val0, ctx.keepPortable());
-
- return F.t((V)val0);
- }
- }
-
- IgniteInternalTx tx = ctx.tm().localTx();
-
- if (tx != null) {
- GridTuple<CacheObject> peek = tx.peek(ctx, failFast, cacheKey, filter);
-
- if (peek != null) {
- CacheObject v = peek.get();
-
- Object val0 = CU.value(v, ctx, true);
-
- val0 = ctx.unwrapPortableIfNeeded(val0, ctx.keepPortable());
-
- return F.t((V)val0);
- }
- }
-
- return null;
- }
- catch (GridCacheEntryRemovedException ignore) {
- if (log.isDebugEnabled())
- log.debug("Got removed entry during 'peek': " + e);
-
- return null;
- }
- catch (IgniteCheckedException ex) {
- throw new IgniteException(ex);
- }
- }
-
- /**
- * @param key Key.
- * @param modes Peek modes.
- * @param tx Transaction to peek at (if modes contains TX value).
- * @return Peeked value.
- * @throws IgniteCheckedException In case of error.
- */
- @Nullable protected V peek0(K key, @Nullable Collection<GridCachePeekMode> modes, IgniteInternalTx tx)
- throws IgniteCheckedException {
- try {
- GridTuple<V> peek = peek0(false, key, modes, tx);
-
- return peek != null ? peek.get() : null;
- }
- catch (GridCacheFilterFailedException ex) {
- ex.printStackTrace();
-
- assert false; // Should never happen.
-
- return null;
- }
- }
-
- /**
- * @param failFast If {@code true}, then filter failure will result in exception.
- * @param key Key.
- * @param modes Peek modes.
- * @param tx Transaction to peek at (if modes contains TX value).
- * @return Peeked value.
- * @throws IgniteCheckedException In case of error.
- * @throws GridCacheFilterFailedException If filer validation failed.
- */
- @Nullable protected GridTuple<V> peek0(boolean failFast, K key, @Nullable Collection<GridCachePeekMode> modes,
- IgniteInternalTx tx) throws IgniteCheckedException, GridCacheFilterFailedException {
- if (F.isEmpty(modes))
- return F.t(peek(key, (CacheEntryPredicate)null));
-
- assert modes != null;
-
- A.notNull(key, "key");
-
- if (keyCheck)
- validateCacheKey(key);
-
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
-
- KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
-
- GridCacheEntryEx e = peekEx(cacheKey);
-
- try {
- for (GridCachePeekMode m : modes) {
- GridTuple<CacheObject> val = null;
-
- if (e != null)
- val = e.peek0(failFast, m, null, tx);
- else if (m == TX || m == SMART)
- val = tx != null ? tx.peek(ctx, failFast, cacheKey, null) : null;
- else if (m == SWAP)
- val = peekSwap(cacheKey);
- else if (m == DB) {
- Object v = peekDb(cacheKey);
-
- if (v != null)
- return new GridTuple<>((V)v);
- }
-
- if (val != null)
- return F.t(CU.<V>value(val.get(), ctx, true));
- }
- }
- catch (GridCacheEntryRemovedException ignore) {
- if (log.isDebugEnabled())
- log.debug("Got removed entry during 'peek': " + e);
- }
-
- return null;
- }
-
- /**
- * @param key Key to read from swap storage.
- * @return Value from swap storage.
- * @throws IgniteCheckedException In case of any errors.
- */
- @Nullable private GridTuple<CacheObject> peekSwap(KeyCacheObject key) throws IgniteCheckedException {
- GridCacheSwapEntry e = ctx.swap().read(key, true, true);
-
- return e != null ? F.t(e.value()) : null;
- }
-
- /**
- * @param key Key to read from persistent store.
- * @return Value from persistent store.
- * @throws IgniteCheckedException In case of any errors.
- */
- @Nullable private Object peekDb(KeyCacheObject key) throws IgniteCheckedException {
- return ctx.store().loadFromStore(ctx.tm().localTxx(), key);
- }
-
- /**
- * @param keys Keys.
- * @param modes Modes.
- * @param tx Transaction.
- * @param skipped Keys skipped during filter validation.
- * @return Peeked values.
- * @throws IgniteCheckedException If failed.
- */
- protected Map<K, V> peekAll0(@Nullable Collection<? extends K> keys, @Nullable Collection<GridCachePeekMode> modes,
- IgniteInternalTx tx, @Nullable Collection<K> skipped) throws IgniteCheckedException {
- if (F.isEmpty(keys))
- return emptyMap();
-
- if (keyCheck)
- validateCacheKeys(keys);
-
- Map<K, V> ret = new HashMap<>(keys.size(), 1.0f);
-
- for (K k : keys) {
- try {
- GridTuple<V> val = peek0(skipped != null, k, modes, tx);
-
- if (val != null)
- ret.put(k, val.get());
- }
- catch (GridCacheFilterFailedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Filter validation failed for key: " + k);
-
- if (skipped != null)
- skipped.add(k);
- }
- }
-
- return ret;
- }
-
/**
* Undeploys and removes all entries for class loader.
*
@@ -1688,17 +1473,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (set || wasNew)
map.put(key, cacheVal);
else {
- try {
- GridTuple<CacheObject> v = entry.peek0(false, GLOBAL, null, null);
+ CacheObject v = entry.peek(true, false, false, null);
- if (v != null)
- map.put(key, v.get());
- }
- catch (GridCacheFilterFailedException ex) {
- ex.printStackTrace();
-
- assert false;
- }
+ if (v != null)
+ map.put(key, v);
}
}
@@ -1807,8 +1585,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (ctx.config().getInterceptor() != null)
fut = fut.chain(new CX1<IgniteInternalFuture<V>, V>() {
- @Override
- public V applyx(IgniteInternalFuture<V> f) throws IgniteCheckedException {
+ @Override public V applyx(IgniteInternalFuture<V> f) throws IgniteCheckedException {
return (V)ctx.config().getInterceptor().onGet(key, f.get());
}
});
@@ -2450,7 +2227,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size() == 1) {
@Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx)
- throws IgniteCheckedException {
+ throws IgniteCheckedException {
Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys,
new C1<K, EntryProcessor<K, V, Object>>() {
@Override public EntryProcessor apply(K k) {
@@ -4756,26 +4533,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
}
/**
- * @param key Key.
- * @param filter Filter to evaluate.
- * @return Peeked value.
- */
- public V peek(K key, @Nullable CacheEntryPredicate filter) {
- try {
- GridTuple<V> peek = peek0(false, key, SMART, filter);
-
- return peek != null ? peek.get() : null;
- }
- catch (GridCacheFilterFailedException e) {
- e.printStackTrace();
-
- assert false; // Should never happen.
-
- return null;
- }
- }
-
- /**
* @param filter Filters to evaluate.
* @return Entry set.
*/
@@ -5170,9 +4927,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
modes.swap = true;
}
else {
- for (int i = 0; i < peekModes.length; i++) {
- CachePeekMode peekMode = peekModes[i];
-
+ for (CachePeekMode peekMode : peekModes) {
A.notNull(peekMode, "peekMode");
switch (peekMode) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index ee17893..8273b24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -211,8 +211,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
undeploys.put(ctx.name(), queue = new ArrayList<>());
queue.add(new CA() {
- @Override
- public void apply() {
+ @Override public void apply() {
onUndeploy0(ldr, ctx);
}
});
@@ -310,7 +309,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
Object val0;
try {
- CacheObject v = entry.peek(GridCachePeekMode.GLOBAL, CU.empty0());
+ CacheObject v = entry.peek(true, false, false, null);
key0 = key.value(cache.context().cacheObjectContext(), false);
@@ -321,7 +320,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
catch (GridCacheEntryRemovedException ignore) {
return false;
}
- catch (IgniteException ignore) {
+ catch (IgniteCheckedException | IgniteException ignore) {
// Peek can throw runtime exception if unmarshalling failed.
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 10176d9..adeb95b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -561,17 +561,6 @@ public interface GridCacheEntryEx {
/**
* Peeks into entry without loading value or updating statistics.
*
- * @param mode Peek mode.
- * @param filter Optional filter.
- * @return Value.
- * @throws GridCacheEntryRemovedException If entry has been removed.
- */
- @Nullable public CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate... filter)
- throws GridCacheEntryRemovedException;
-
- /**
- * Peeks into entry without loading value or updating statistics.
- *
* @param heap Read from heap flag.
* @param offheap Read from offheap flag.
* @param swap Read from swap flag.
@@ -591,30 +580,19 @@ public interface GridCacheEntryEx {
/**
* Peeks into entry without loading value or updating statistics.
*
- * @param modes Peek modes.
- * @param filter Optional filter.
+ * @param heap Heap.
+ * @param offheap Offheap.
+ * @param swap Swap.
+ * @param plc Policy.
* @return Value.
* @throws GridCacheEntryRemovedException If entry has been removed.
+ * @throws IgniteCheckedException If failed.
*/
- @Nullable public CacheObject peek(Collection<GridCachePeekMode> modes,
- CacheEntryPredicate... filter) throws GridCacheEntryRemovedException;
-
- /**
- * @param failFast Fail-fast flag.
- * @param mode Peek mode.
- * @param filter Filter.
- * @param tx Transaction to peek value at (if mode is TX value).
- * @return Peeked value.
- * @throws IgniteCheckedException In case of error.
- * @throws GridCacheEntryRemovedException If removed.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @SuppressWarnings({"RedundantTypeArguments"})
- @Nullable public GridTuple<CacheObject> peek0(boolean failFast,
- GridCachePeekMode mode,
- @Nullable CacheEntryPredicate[] filter,
- @Nullable IgniteInternalTx tx)
- throws GridCacheEntryRemovedException, GridCacheFilterFailedException, IgniteCheckedException;
+ @Nullable public CacheObject peek(boolean heap,
+ boolean offheap,
+ boolean swap,
+ @Nullable IgniteCacheExpiryPolicy plc)
+ throws GridCacheEntryRemovedException, IgniteCheckedException;
/**
* This method overwrites current in-memory value with new value.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 58ff57f..14fa2f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -47,7 +47,6 @@ import java.util.concurrent.atomic.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.internal.processors.dr.GridDrType.*;
-import static org.apache.ignite.transactions.TransactionState.*;
/**
* Adapter for cache entry.
@@ -2755,25 +2754,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
}
/** {@inheritDoc} */
- @Nullable @Override public CacheObject peek(GridCachePeekMode mode,
- CacheEntryPredicate[] filter)
- throws GridCacheEntryRemovedException {
- try {
- GridTuple<CacheObject> peek = peek0(false, mode, filter, cctx.tm().localTxx());
-
- return peek != null ? peek.get() : null;
- }
- catch (GridCacheFilterFailedException ignore) {
- assert false;
-
- return null;
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException("Unable to perform entry peek() operation.", e);
- }
- }
-
- /** {@inheritDoc} */
@Nullable @Override public CacheObject peek(boolean heap,
boolean offheap,
boolean swap,
@@ -2807,88 +2787,17 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
}
/** {@inheritDoc} */
- @Override public CacheObject peek(Collection<GridCachePeekMode> modes,
- CacheEntryPredicate[] filter)
- throws GridCacheEntryRemovedException {
- assert modes != null;
-
- for (GridCachePeekMode mode : modes) {
- try {
- GridTuple<CacheObject> val = peek0(false, mode, filter, cctx.tm().localTxx());
-
- if (val != null)
- return val.get();
- }
- catch (GridCacheFilterFailedException ignored) {
- assert false;
-
- return null;
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException("Unable to perform entry peek() operation.", e);
- }
- }
-
- return null;
- }
-
- /**
- * @param failFast Fail-fast flag.
- * @param mode Peek mode.
- * @param filter Filter.
- * @param tx Transaction to peek value at (if mode is TX value).
- * @return Peeked value.
- * @throws IgniteCheckedException In case of error.
- * @throws GridCacheEntryRemovedException If removed.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @SuppressWarnings({"RedundantTypeArguments"})
- @Nullable @Override public GridTuple<CacheObject> peek0(boolean failFast, GridCachePeekMode mode,
- CacheEntryPredicate[] filter, @Nullable IgniteInternalTx tx)
- throws GridCacheEntryRemovedException, GridCacheFilterFailedException, IgniteCheckedException {
- assert tx == null || tx.local();
+ @Nullable @Override public CacheObject peek(
+ boolean heap,
+ boolean offheap,
+ boolean swap,
+ @Nullable IgniteCacheExpiryPolicy plc)
+ throws GridCacheEntryRemovedException, IgniteCheckedException {
+ IgniteInternalTx tx = cctx.tm().localTxx();
AffinityTopologyVersion topVer = tx != null ? tx.topologyVersion() : cctx.affinity().affinityTopologyVersion();
- switch (mode) {
- case TX:
- return peekTx(failFast, filter, tx);
-
- case GLOBAL:
- return peekGlobal(failFast, topVer, filter, null);
-
- case NEAR_ONLY:
- return peekGlobal(failFast, topVer, filter, null);
-
- case PARTITIONED_ONLY:
- return peekGlobal(failFast, topVer, filter, null);
-
- case SMART:
- /*
- * If there is no ongoing transaction, or transaction is NOT in ACTIVE state,
- * which means that it is either rolling back, preparing to commit, or committing,
- * then we only check the global cache storage because value has already been
- * validated against filter and enlisted into transaction and, therefore, second
- * validation against the same enlisted value will be invalid (it will always be false).
- *
- * However, in ACTIVE state, we must also validate against other values that
- * may have enlisted into the same transaction and that's why we pass 'true'
- * to 'e.peek(true)' method in this case.
- */
- return tx == null || tx.state() != ACTIVE ? peekGlobal(failFast, topVer, filter, null) :
- peekTxThenGlobal(failFast, filter, tx);
-
- case SWAP:
- return peekSwap(failFast, filter);
-
- case DB:
- return F.t(peekDb(failFast, filter));
-
- default: // Should never be reached.
- assert false;
-
- return null;
- }
+ return peek(heap, offheap, swap, topVer, plc);
}
/** {@inheritDoc} */
@@ -2952,31 +2861,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
* @param tx Transaction to peek value at (if mode is TX value).
* @return Peeked value.
* @throws GridCacheFilterFailedException If filter failed.
- * @throws GridCacheEntryRemovedException If entry got removed.
- * @throws IgniteCheckedException If unexpected cache failure occurred.
- */
- @Nullable private GridTuple<CacheObject> peekTxThenGlobal(boolean failFast,
- CacheEntryPredicate[] filter,
- IgniteInternalTx tx)
- throws GridCacheFilterFailedException, GridCacheEntryRemovedException, IgniteCheckedException
- {
- GridTuple<CacheObject> peek = peekTx(failFast, filter, tx);
-
- // If transaction has value (possibly null, which means value is to be deleted).
- if (peek != null)
- return peek;
-
- AffinityTopologyVersion topVer = tx == null ? cctx.affinity().affinityTopologyVersion() : tx.topologyVersion();
-
- return peekGlobal(failFast, topVer, filter, null);
- }
-
- /**
- * @param failFast Fail fast flag.
- * @param filter Filter.
- * @param tx Transaction to peek value at (if mode is TX value).
- * @return Peeked value.
- * @throws GridCacheFilterFailedException If filter failed.
*/
@Nullable private GridTuple<CacheObject> peekTx(boolean failFast,
CacheEntryPredicate[] filter,
@@ -3043,52 +2927,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
}
/**
- * @param failFast Fail fast flag.
- * @param filter Filter.
- * @return Value from swap storage.
- * @throws IgniteCheckedException In case of any errors.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @SuppressWarnings({"unchecked"})
- @Nullable private GridTuple<CacheObject> peekSwap(boolean failFast,
- CacheEntryPredicate[] filter)
- throws IgniteCheckedException, GridCacheFilterFailedException
- {
- if (!cctx.isAll(this, filter))
- return F.t(CU.failed(failFast));
-
- synchronized (this) {
- if (checkExpired())
- return null;
- }
-
- GridCacheSwapEntry e = cctx.swap().read(this, false, true, true);
-
- return e != null ? F.t(e.value()) : null;
- }
-
- /**
- * @param failFast Fail fast flag.
- * @param filter Filter.
- * @return Value from persistent store.
- * @throws IgniteCheckedException In case of any errors.
- * @throws GridCacheFilterFailedException If filter failed.
- */
- @SuppressWarnings({"unchecked"})
- @Nullable private CacheObject peekDb(boolean failFast, CacheEntryPredicate[] filter)
- throws IgniteCheckedException, GridCacheFilterFailedException {
- if (!cctx.isAll(this, filter))
- return CU.failed(failFast);
-
- synchronized (this) {
- if (checkExpired())
- return null;
- }
-
- return cctx.toCacheObject(cctx.store().loadFromStore(cctx.tm().localTxx(), key));
- }
-
- /**
* TODO: GG-4009: do we need to generate event and invalidate value?
*
* @return {@code true} if expired.
@@ -3790,11 +3628,14 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
return null;
try {
- return e.peek(GridCachePeekMode.GLOBAL, CU.empty0());
+ return e.peek(true, false, false, null);
}
catch (GridCacheEntryRemovedException ignored) {
// No-op.
}
+ catch (IgniteCheckedException ex) {
+ throw new IgniteException(ex);
+ }
}
}
catch (GridCacheFilterFailedException ignored) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java
deleted file mode 100644
index 0aef1ee..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.jetbrains.annotations.*;
-
-/**
- * Enumeration of all supported cache peek modes. Peek modes can be passed into various
- * {@code 'CacheProjection.peek(..)'} and {@code Entry.peek(..)} methods.
- * <p>
- * The following modes are supported:
- * <ul>
- * <li>{@link #TX}</li>
- * <li>{@link #GLOBAL}</li>
- * <li>{@link #SMART}</li>
- * <li>{@link #SWAP}</li>
- * <li>{@link #DB}</li>
- * </ul>
- */
-public enum GridCachePeekMode {
- /** Peeks value only from in-transaction memory of an ongoing transaction, if any. */
- TX,
-
- /** Peeks at cache global (not in-transaction) memory. */
- GLOBAL,
-
- /**
- * In this mode value is peeked from in-transaction memory first using {@link #TX}
- * mode and then, if it has not been found there, {@link #GLOBAL} mode is used to
- * search in committed cached values.
- */
- SMART,
-
- /** Peeks value only from off-heap or cache swap storage without loading swapped value into cache. */
- SWAP,
-
- /** Peek value from the underlying persistent storage without loading this value into cache. */
- DB,
-
- /**
- * Peek value from near cache only (don't peek from partitioned cache).
- * In case of {@link org.apache.ignite.cache.CacheMode#LOCAL} or {@link org.apache.ignite.cache.CacheMode#REPLICATED} cache,
- * behaves as {@link #GLOBAL} mode.
- */
- NEAR_ONLY,
-
- /**
- * Peek value from partitioned cache only (skip near cache).
- * In case of {@link org.apache.ignite.cache.CacheMode#LOCAL} or {@link org.apache.ignite.cache.CacheMode#REPLICATED} cache,
- * behaves as {@link #GLOBAL} mode.
- */
- PARTITIONED_ONLY;
-
- /** Enumerated values. */
- private static final GridCachePeekMode[] VALS = values();
-
- /**
- * Efficiently gets enumerated value from its ordinal.
- *
- * @param ord Ordinal value.
- * @return Enumerated value or {@code null} if ordinal out of range.
- */
- @Nullable public static GridCachePeekMode fromOrdinal(byte ord) {
- return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index 53d353f..9730c39 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.processors.cache.dr.*;
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -584,11 +583,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
}
/** {@inheritDoc} */
- @Override public V peek(K key) {
- return cache.peek(key);
- }
-
- /** {@inheritDoc} */
@Nullable @Override public V localPeek(K key,
CachePeekMode[] peekModes,
@Nullable IgniteCacheExpiryPolicy plc)
@@ -603,11 +597,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
}
/** {@inheritDoc} */
- @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- return cache.peek(key, modes);
- }
-
- /** {@inheritDoc} */
@Nullable @Override public Cache.Entry<K, V> entry(K key) {
return cache.entry(key);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index d2a561a..2e8449e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -1123,18 +1123,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
}
/** {@inheritDoc} */
- @Nullable @Override public V peek(K key) {
- GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
- try {
- return delegate.peek(key);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Nullable @Override public V localPeek(K key,
CachePeekMode[] peekModes,
@Nullable IgniteCacheExpiryPolicy plc)
@@ -1163,18 +1151,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
}
/** {@inheritDoc} */
- @Nullable @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
- try {
- return delegate.peek(key, modes);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Nullable @Override public Cache.Entry<K, V> entry(K key) {
GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 8f48d3d..8c72bc2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -56,7 +56,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
import static org.apache.ignite.internal.GridTopic.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
/**
* Cache utility methods.
@@ -77,9 +76,6 @@ public class GridCacheUtils {
/** Default mask name. */
private static final String DEFAULT_MASK_NAME = "<default>";
- /** Peek flags. */
- private static final GridCachePeekMode[] PEEK_FLAGS = new GridCachePeekMode[] { GLOBAL, SWAP };
-
/** TTL: minimum positive value. */
public static final long TTL_MINIMUM = 1L;
@@ -1026,13 +1022,6 @@ public class GridCacheUtils {
}
/**
- * @return Peek flags.
- */
- public static GridCachePeekMode[] peekFlags() {
- return PEEK_FLAGS;
- }
-
- /**
* @param log Logger.
* @param excl Excludes.
* @return Future listener that logs errors.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 6c27566..475fea6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
@@ -874,8 +875,12 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
Cache.Entry<K, V> entry = (Cache.Entry<K, V>)o;
- return partId == ctx.affinity().partition(entry.getKey()) &&
- F.eq(entry.getValue(), peek(entry.getKey()));
+ try {
+ return partId == ctx.affinity().partition(entry.getKey()) &&
+ F.eq(entry.getValue(), localPeek(entry.getKey(), new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+ } catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index c376fa0..2d7f58f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
@@ -33,7 +34,6 @@ import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.processors.timeout.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -56,7 +56,6 @@ import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
import static org.apache.ignite.internal.processors.dr.GridDrType.*;
@@ -254,27 +253,11 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
- return new CacheEntryImpl<>(key, peek(key));
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("ConstantConditions")
- @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- GridTuple<V> val = null;
-
- if (ctx.isReplicated() || !modes.contains(NEAR_ONLY)) {
- try {
- val = peek0(true, key, modes, ctx.tm().txx());
- }
- catch (GridCacheFilterFailedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Filter validation failed for key: " + key);
-
- return null;
- }
+ try {
+ return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+ } catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
}
-
- return val != null ? val.get() : null;
}
/** {@inheritDoc} */
@@ -1783,8 +1766,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (hasNear) {
if (primary && updRes.sendToDht()) {
if (!ctx.affinity().belongs(node, entry.partition(), topVer)) {
- GridCacheVersionConflictContext ctx = updRes.conflictResolveResult();
-
// If put the same value as in request then do not need to send it back.
if (op == TRANSFORM || writeVal != updRes.newValue()) {
res.addNearValue(i,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index eb6d9a6..8d4f153 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.colocated;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.affinity.*;
@@ -28,7 +29,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.plugin.security.*;
@@ -39,8 +39,6 @@ import javax.cache.*;
import java.io.*;
import java.util.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
-
/**
* Colocated cache.
*/
@@ -82,14 +80,13 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
map.setEntryFactory(new GridCacheMapEntryFactory() {
/** {@inheritDoc} */
@Override public GridCacheMapEntry create(GridCacheContext ctx,
- AffinityTopologyVersion topVer,
- KeyCacheObject key,
- int hash,
- CacheObject val,
- GridCacheMapEntry next,
- long ttl,
- int hdrId)
- {
+ AffinityTopologyVersion topVer,
+ KeyCacheObject key,
+ int hash,
+ CacheObject val,
+ GridCacheMapEntry next,
+ long ttl,
+ int hdrId) {
return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, val, next, ttl, hdrId);
}
});
@@ -134,25 +131,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
}
/** {@inheritDoc} */
- @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- GridTuple<V> val = null;
-
- if (!modes.contains(NEAR_ONLY)) {
- try {
- val = peek0(true, key, modes, ctx.tm().txx());
- }
- catch (GridCacheFilterFailedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Filter validation failed for key: " + key);
-
- return null;
- }
- }
-
- return val != null ? val.get() : null;
- }
-
- /** {@inheritDoc} */
@Override public boolean isLocked(K key) {
KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
@@ -410,7 +388,12 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
/** {@inheritDoc} */
@Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
- return new CacheEntryImpl<>(key, peek(key));
+ try {
+ return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 75c8978..241af05 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -38,8 +37,6 @@ import javax.cache.expiry.*;
import java.io.*;
import java.util.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
-
/**
* Common logic for near caches.
*/
@@ -443,7 +440,11 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
@Override public Cache.Entry<K, V> entry(K key) {
// We don't try wrap entry from near or dht cache.
// Created object will be wrapped once some method is called.
- return new CacheEntryImpl<>(key, peek(key));
+ try {
+ return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+ } catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/**
@@ -454,11 +455,9 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
*/
@Nullable public V peekNearOnly(K key) {
try {
- GridTuple<V> peek = peek0(true, key, SMART, CU.empty0());
-
- return peek != null ? peek.get() : null;
+ return localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
}
- catch (GridCacheFilterFailedException ignored) {
+ catch (IgniteCheckedException ignored) {
if (log.isDebugEnabled())
log.debug("Filter validation failed for key: " + key);
@@ -467,45 +466,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
}
/** {@inheritDoc} */
- @Override public V peek(K key, @Nullable CacheEntryPredicate filter) {
- try {
- GridTuple<V> res = peek0(false, key, SMART, filter);
-
- if (res != null)
- return res.get();
- }
- catch (GridCacheFilterFailedException e) {
- e.printStackTrace();
-
- assert false : "Filter should not fail since fail-fast is false";
- }
-
- return dht().peek(key, filter);
- }
-
- /** {@inheritDoc} */
- @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
- GridTuple<V> val = null;
-
- if (!modes.contains(PARTITIONED_ONLY)) {
- try {
- val = peek0(true, key, modes, ctx.tm().txx());
- }
- catch (GridCacheFilterFailedException ignored) {
- if (log.isDebugEnabled())
- log.debug("Filter validation failed for key: " + key);
-
- return null;
- }
- }
-
- if (val != null)
- return val.get();
-
- return !modes.contains(NEAR_ONLY) ? dht().peek(key, modes) : null;
- }
-
- /** {@inheritDoc} */
@Override public boolean clearLocally0(K key, @Nullable CacheEntryPredicate[] filter) {
return super.clearLocally0(key, filter) | dht().clearLocally0(key, filter);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
index 9969f65..8c597e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
@@ -26,15 +26,12 @@ import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.transactions.*;
import org.jetbrains.annotations.*;
import java.io.*;
import java.util.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
-
/**
* Transaction created by system implicitly on remote nodes.
*/
@@ -296,7 +293,9 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
cached.unswap();
try {
- if (cached.peek(GLOBAL, CU.empty0()) == null && cached.evictInternal(false, xidVer, null)) {
+ CacheObject val = cached.peek(true, false, false, null);
+
+ if (val == null && cached.evictInternal(false, xidVer, null)) {
evicted.add(entry.txKey());
return false;
@@ -350,7 +349,9 @@ public class GridNearTxRemote extends GridDistributedTxRemoteAdapter {
else {
cached.unswap();
- if (cached.peek(GLOBAL, CU.empty0()) == null && cached.evictInternal(false, xidVer, null)) {
+ CacheObject peek = cached.peek(true, false, false, null);
+
+ if (peek == null && cached.evictInternal(false, xidVer, null)) {
cached.context().cache().removeIfObsolete(key.key());
evicted.add(key);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index 9eac084..4add987 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.task;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.events.*;
@@ -343,7 +344,13 @@ public class GridTaskProcessor extends GridProcessorAdapter {
assert ctx.security().enabled();
- return tasksMetaCache.peek(new GridTaskNameHashKey(taskNameHash));
+ try {
+ return tasksMetaCache.localPeek(
+ new GridTaskNameHashKey(taskNameHash), new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index ccc6aae..21cc7a3 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -381,7 +381,6 @@ org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$3
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$4
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeFutureSet
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$MessageHandler
-org.apache.ignite.internal.processors.cache.GridCachePeekMode
org.apache.ignite.internal.processors.cache.GridCacheProcessor$2
org.apache.ignite.internal.processors.cache.GridCacheProcessor$3
org.apache.ignite.internal.processors.cache.GridCacheProcessor$4
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
index 3624b58..89646e9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
@@ -95,7 +96,6 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
/**
* @throws Exception If failed.
*/
- @SuppressWarnings("BusyWait")
public void testEvictions() throws Exception {
try {
final Ignite ignite1 = startGrid(1);
@@ -240,7 +240,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
", s2=" + cache2.size() + ']';
for (Integer key : cache1.keySet()) {
- Object e = cache1.peek(key);
+ Object e = cache1.localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
if (e != null)
assert cache2.containsKey(key) : "Cache2 does not contain key: " + key;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
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 1d86984..9bdde1b 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
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.processors.dr.*;
import org.apache.ignite.internal.util.lang.*;
-import org.apache.ignite.internal.util.typedef.*;
import org.jetbrains.annotations.*;
import javax.cache.*;
@@ -607,25 +606,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
return ver;
}
- /** @inheritDoc */
- @Override public CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate[] filter) {
- return val;
- }
-
- /** @inheritDoc */
- @Override public GridTuple<CacheObject> peek0(boolean failFast, GridCachePeekMode mode,
- CacheEntryPredicate[] filter, IgniteInternalTx tx)
- throws GridCacheEntryRemovedException, GridCacheFilterFailedException, IgniteCheckedException {
- return F.t(val);
- }
-
- /** @inheritDoc */
- @Override public CacheObject peek(Collection<GridCachePeekMode> modes,
- CacheEntryPredicate[] filter)
- throws GridCacheEntryRemovedException {
- return val;
- }
-
/** {@inheritDoc} */
@Override public CacheObject poke(CacheObject val) throws GridCacheEntryRemovedException, IgniteCheckedException {
CacheObject old = this.val;
@@ -859,4 +839,15 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
{
return null;
}
+
+ /** {@inheritDoc} */
+ @Nullable @Override public CacheObject peek(
+ boolean heap,
+ boolean offheap,
+ boolean swap,
+ @Nullable IgniteCacheExpiryPolicy plc)
+ throws GridCacheEntryRemovedException, IgniteCheckedException {
+ return null;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index cf1882a..99b95ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -256,7 +256,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
assert entryPrimary != null;
assert entryBackup != null;
- assertEquals(val, nearOther.peek(key));
+ assertEquals(val, localPeek(nearOther, key));
assertTrue(!entryPrimary.readers().isEmpty());
@@ -268,13 +268,13 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
futBackup.get(3000);
futPrimary.get(3000);
- assertNull(dhtPrimary.peek(key));
- assertNull(nearPrimary.peek(key));
+ assertNull(localPeek(dhtPrimary, key));
+ assertNull(localPeek(nearPrimary, key));
- assertNull(dhtBackup.peek(key));
- assertNull(nearBackup.peek(key));
+ assertNull(localPeek(dhtBackup, key));
+ assertNull(localPeek(nearBackup, key));
- assertNull(dhtOther.peek(key));
- assertNull(nearOther.peek(key));
+ assertNull(localPeek(dhtOther, key));
+ assertNull(localPeek(nearOther, key));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
index 3b16864..39ef872 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
@@ -210,11 +210,11 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
// Put on primary node.
nearPrimary.put(key, val, null);
- assertEquals(val, nearPrimary.peek(key));
- assertEquals(val, dhtPrimary.peek(key));
+ assertEquals(val, localPeek(nearPrimary, key));
+ assertEquals(val, localPeek(dhtPrimary, key));
- assertEquals(val, nearBackup.peek(key));
- assertEquals(val, dhtBackup.peek(key));
+ assertEquals(val, localPeek(nearBackup, key));
+ assertEquals(val, localPeek(dhtBackup, key));
GridDhtCacheEntry entryPrimary = (GridDhtCacheEntry)dhtPrimary.peekEx(key);
GridDhtCacheEntry entryBackup = (GridDhtCacheEntry)dhtBackup.peekEx(key);
@@ -281,11 +281,11 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
for (Integer key : keys) {
String val = "v" + key;
- assertEquals(val, nearPrimary.peek(key));
- assertEquals(val, dhtPrimary.peek(key));
+ assertEquals(val, localPeek(nearPrimary, key));
+ assertEquals(val, localPeek(dhtPrimary, key));
- assertEquals(val, nearBackup.peek(key));
- assertEquals(val, dhtBackup.peek(key));
+ assertEquals(val, localPeek(nearBackup, key));
+ assertEquals(val, localPeek(dhtBackup, key));
}
final AtomicInteger cntBackup = new AtomicInteger();
@@ -324,8 +324,8 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
for (Integer key : keys) {
String msg = "Failed key: " + key;
- assertNull(msg, nearBackup.peek(key));
- assertNull(msg, dhtBackup.peek(key));
+ assertNull(msg, localPeek(nearBackup, key));
+ assertNull(msg, localPeek(dhtBackup, key));
assertNull(msg, nearBackup.peekEx(key));
assertNull(msg, dhtBackup.peekEx(key));
}
@@ -333,8 +333,8 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
for (Integer key : keys) {
String msg = "Failed key: " + key;
- assertNull(msg, nearPrimary.peek(key));
- assertNull(msg, dhtPrimary.peek(key));
+ assertNull(msg, localPeek(nearPrimary, key));
+ assertNull(msg, localPeek(dhtPrimary, key));
assertNull(msg, nearPrimary.peekEx(key));
assertNull(dhtPrimary.peekEx(key));
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
index 682a321..bf8a27b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
@@ -90,7 +90,7 @@ public class GridCacheDhtMappingSelfTest extends GridCommonAbstractTest {
GridDhtCacheAdapter<Integer, Integer> dht = ((GridNearCacheAdapter<Integer, Integer>)
((IgniteKernal)g).<Integer, Integer>internalCache()).dht();
- if (dht.peek(kv) != null) {
+ if (localPeek(dht, kv) != null) {
info("Key found on node: " + g.cluster().localNode().id());
cnt++;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
index b3b04e0..8a9816d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
@@ -44,7 +44,6 @@ import java.util.concurrent.locks.*;
import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.internal.processors.cache.GridCachePeekMode.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
import static org.apache.ignite.transactions.TransactionIsolation.*;
@@ -186,15 +185,6 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
}
/**
- * @param g Grid.
- * @return Dht cache.
- */
- @SuppressWarnings({"unchecked", "TypeMayBeWeakened"})
- private GridNearCacheAdapter<Integer, String> near(Ignite g) {
- return (GridNearCacheAdapter)((IgniteKernal)g).internalCache();
- }
-
- /**
* @param idx Index.
* @return Affinity.
*/
@@ -359,7 +349,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
GridCacheAdapter<Integer, String> dhtCache = dht(G.ignite(n.id()));
- String s = dhtCache.peek(key);
+ String s = dhtCache.localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
assert s != null : "Value is null for key: " + key;
assertEquals(s, Integer.toString(key));
@@ -392,7 +382,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
if (entry != null)
assertNull("Unexpected entry: " + entry, entry.rawGetOrUnmarshal(false));
- assertNotNull(dht(primaryGrid(3)).peek(3));
+ assertNotNull(localPeek(dht(primaryGrid(3)), 3));
tx.commit();
}
@@ -409,8 +399,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
assertEquals("3", near.localPeek(3, CachePeekMode.ONHEAP));
- assertEquals("2", dht(primaryGrid(2)).peek(2));
- assertEquals("3", dht(primaryGrid(3)).peek(3));
+ assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+ assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
assertEquals(2, near.localSize());
assertEquals(2, near.localSize());
@@ -425,7 +415,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
assertEquals("2", near.get(2));
- assertEquals("2", dht(primaryGrid(2)).peek(2));
+ assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
assertEquals(1, near.localSize());
assertEquals(1, near.localSize());
@@ -454,7 +444,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
info("Primary grid for key 3: " + U.toShortString(primaryIgnite.cluster().localNode()));
- assertEquals("3", dht(primaryIgnite).peek(3));
+ assertEquals("3", localPeek(dht(primaryIgnite), 3));
assertEquals(1, near.localSize());
assertEquals(1, near.localSize());
@@ -469,7 +459,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
for (Ignite b : backups) {
info("Backup grid for key 3: " + U.toShortString(b.cluster().localNode()));
- assertEquals("3", dht(b).peek(3));
+ assertEquals("3", localPeek(dht(b), 3));
assertEquals(1, dht(b).size());
}
@@ -492,8 +482,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals("2", near.get(2));
assertEquals("3", near.get(3));
- assertEquals("2", dht(primaryGrid(2)).peek(2));
- assertEquals("3", dht(primaryGrid(3)).peek(3));
+ assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+ assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
assertEquals(2, near.localSize());
assertEquals(2, near.localSize());
@@ -519,7 +509,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals("2", near.get(2));
assertEquals("3", near.get(3));
- assertNotNull(dht(primaryGrid(3)).peek(3, F.asList(GLOBAL)));
+ assertNotNull(dht(primaryGrid(3)).localPeek(3, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
tx.commit();
}
@@ -536,8 +526,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
assertEquals("3", near.localPeek(3, CachePeekMode.ONHEAP));
- assertEquals("2", dht(primaryGrid(2)).peek(2));
- assertEquals("3", dht(primaryGrid(3)).peek(3));
+ assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+ assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
assertEquals(2, near.localSize());
assertEquals(2, near.localSize());
@@ -604,8 +594,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertNull(near0.peekNearOnly(key));
assertNull(near1.peekNearOnly(key));
- assertEquals(val, dht0.peek(key));
- assertEquals(val, dht1.peek(key));
+ assertEquals(val, localPeek(dht0, key));
+ assertEquals(val, localPeek(dht1, key));
}
/** @throws Exception If failed. */
@@ -688,8 +678,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertTrue("Invalid near entry [hash=" + nearEntry2, nearEntry2.valid(topVer));
assertEquals(val, cache.localPeek(key, CachePeekMode.ONHEAP));
- assertEquals(val, dht(0).peek(key));
- assertEquals(val, dht(1).peek(key));
+ assertEquals(val, dhtPeek(0, key));
+ assertEquals(val, dhtPeek(1, key));
GridNearCacheEntry nearEntry3 = nearEntry(0, key);
@@ -707,7 +697,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals(val, cache.getAndRemove(key));
assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
- assertNull(dht(primaryGrid(key)).peek(key));
+ assertNull(localPeek(dht(primaryGrid(key)), key));
assertTrue(cache.isLocalLocked(key, false));
assertTrue(cache.isLocalLocked(key, true));
@@ -753,7 +743,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
near.put(key, val);
assertEquals(val, near.localPeek(key, CachePeekMode.ONHEAP));
- assertEquals(val, dht(primaryGrid(key)).peek(key));
+ assertEquals(val, localPeek(dht(primaryGrid(key)), key));
assertTrue(near.isLocalLocked(key, false));
assertTrue(near.isLocalLocked(key, true));
@@ -765,7 +755,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertEquals(val, near.getAndRemove(key));
assertNull(near.localPeek(key, CachePeekMode.ONHEAP));
- assertNull(dht(primaryGrid(key)).peek(key));
+ assertNull(localPeek(dht(primaryGrid(key)), key));
assertTrue(near.isLocalLocked(key, false));
assertTrue(near.isLocalLocked(key, true));
@@ -811,8 +801,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
cache.put(key, val);
- assertEquals(val, dht(0).peek(key));
- assertEquals(val, dht(1).peek(key));
+ assertEquals(val, dhtPeek(0, key));
+ assertEquals(val, dhtPeek(1, key));
assertNull(near(0).peekNearOnly(key));
assertNull(near(1).peekNearOnly(key));
@@ -829,8 +819,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
else
assertEquals(val, cache.get(key));
- assertEquals(val, dht(0).peek(key));
- assertEquals(val, dht(1).peek(key));
+ assertEquals(val, dhtPeek(0, key));
+ assertEquals(val, dhtPeek(1, key));
assertNull(near(0).peekNearOnly(key));
assertNull(near(1).peekNearOnly(key));
@@ -857,8 +847,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
cache.put(key, val);
- assertEquals(val, dht(0).peek(key));
- assertEquals(val, dht(1).peek(key));
+ assertEquals(val, dhtPeek(0, key));
+ assertEquals(val, dhtPeek(1, key));
assertNull(near(0).peekNearOnly(key));
assertNull(near(1).peekNearOnly(key));
@@ -882,8 +872,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
assertTrue(cache.remove(key));
}
- assertNull(dht(0).peek(key));
- assertNull(dht(1).peek(key));
+ assertNull(dhtPeek(0, key));
+ assertNull(dhtPeek(1, key));
assertNull(near(0).peekNearOnly(key));
assertNull(near(1).peekNearOnly(key));
@@ -926,14 +916,6 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
return map.get(key);
}
- /**
- * @param key Key.
- * @return {@code True} if has value.
- */
- boolean hasValue(Integer key) {
- return map.containsKey(key);
- }
-
/** @return {@code True} if empty. */
boolean isEmpty() {
return map.isEmpty();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfb4679f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
index d361d91..3cc4e01 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
@@ -27,7 +27,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.junits.common.*;
import org.apache.ignite.transactions.*;
-import javax.cache.configuration.*;
import java.util.concurrent.*;
import java.util.concurrent.locks.*;
@@ -132,7 +131,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
assertEquals(1, near.size());
assertEquals(1, near.size());
- String d = dht.peek(1);
+ String d = localPeek(dht, 1);
assert d != null;
assertEquals(d, "1");
@@ -163,7 +162,6 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
GridCacheEntryEx entry = dht.peekEx(2);
assert entry == null || entry.rawGetOrUnmarshal(false) == null : "Invalid entry: " + entry;
- assert dht.peek(3) != null;
tx.commit();
}
@@ -215,13 +213,13 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
near.put(1, "1");
assertEquals("1", near.localPeek(1, CachePeekMode.ONHEAP));
- assertEquals("1", dht().peek(1));
+ assertEquals("1", dhtPeek(1));
assertEquals("1", near.get(1));
assertEquals("1", near.getAndRemove(1));
assertNull(near.localPeek(1, CachePeekMode.ONHEAP));
- assertNull(dht().peek(1));
+ assertNull(dhtPeek(1));
assertTrue(near.isLocalLocked(1, false));
assertTrue(near.isLocalLocked(1, true));
@@ -246,7 +244,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
near.put(1, "1");
assertEquals("1", near.localPeek(1, CachePeekMode.ONHEAP));
- assertEquals("1", dht().peek(1));
+ assertEquals("1", dhtPeek(1));
assertTrue(near.isLocalLocked(1, false));
assertTrue(near.isLocalLocked(1, true));
@@ -258,7 +256,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
assertEquals("1", near.getAndRemove(1));
assertNull(near.localPeek(1, CachePeekMode.ONHEAP));
- assertNull(dht().peek(1));
+ assertNull(dhtPeek(1));
assertTrue(near.isLocalLocked(1, false));
assertTrue(near.isLocalLocked(1, true));
@@ -284,7 +282,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
cache.put(1, "val1");
- assertEquals("val1", dht().peek(1));
+ assertEquals("val1", dhtPeek(1));
assertNull(near().peekNearOnly(1));
Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -293,7 +291,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
tx.commit();
- assertEquals("val1", dht().peek(1));
+ assertEquals("val1", dhtPeek(1));
assertNull(near().peekNearOnly(1));
}
@@ -303,7 +301,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
cache.put(1, "val1");
- assertEquals("val1", dht().peek(1));
+ assertEquals("val1", dhtPeek(1));
assertNull(near().peekNearOnly(1));
Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -314,7 +312,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
tx.commit();
- assertNull(dht().peek(1));
+ assertNull(dhtPeek(1));
assertNull(near().peekNearOnly(1));
}
@@ -337,11 +335,6 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
create = true;
}
- /** @param create Create flag. */
- void create(boolean create) {
- this.create = create;
- }
-
/** @return Create flag. */
boolean isCreate() {
return create;
[04/23] incubator-ignite git commit: ignite-gg-10009: add tests to
test suite.
Posted by ak...@apache.org.
ignite-gg-10009: add tests to test suite.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fd51341c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fd51341c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fd51341c
Branch: refs/heads/ignite-593
Commit: fd51341c05024ef4a501c756fc2db001f4d3a9c3
Parents: b8f6904
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Apr 1 17:57:26 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Apr 1 17:57:26 2015 +0300
----------------------------------------------------------------------
.../cache/ttl/CacheTtlAbstractSelfTest.java | 4 +--
...lOnheapTransactionalPartitionedSelfTest.java | 34 ++++++++++++++++++++
.../IgniteH2IndexingSpiTestSuite.java | 11 +++++++
3 files changed, 47 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd51341c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index 25d32c0..552e2ea 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -172,11 +172,11 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
*/
private void checkSizeBeforeLive(IgniteCache<Integer, Integer> cache, int size) throws Exception {
if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) {
- assertEquals(0, cache.localSize());
+ assertEquals(0, cache.localSize(CachePeekMode.ONHEAP));
assertEquals(size, cache.localSize(CachePeekMode.OFFHEAP));
}
else {
- assertEquals(size > MAX_CACHE_SIZE ? MAX_CACHE_SIZE : size, cache.localSize());
+ assertEquals(size > MAX_CACHE_SIZE ? MAX_CACHE_SIZE : size, cache.localSize(CachePeekMode.ONHEAP));
assertEquals(size > MAX_CACHE_SIZE ? size - MAX_CACHE_SIZE : 0, cache.localSize(CachePeekMode.OFFHEAP));
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd51341c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalPartitionedSelfTest.java
new file mode 100644
index 0000000..6f88844
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOnheapTransactionalPartitionedSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlOnheapTransactionalPartitionedSelfTest extends CacheTtlOnheapTransactionalAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fd51341c/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
index bd9cca6..21076bd 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
@@ -19,6 +19,7 @@ package org.apache.ignite.testsuites;
import junit.framework.*;
import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.ttl.*;
import org.apache.ignite.internal.processors.query.h2.*;
import org.apache.ignite.internal.processors.query.h2.opt.*;
@@ -51,6 +52,16 @@ public class IgniteH2IndexingSpiTestSuite extends TestSuite {
suite.addTestSuite(GridCacheSwapSelfTest.class);
suite.addTestSuite(GridCacheOffHeapSelfTest.class);
+ //ttl
+ suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapTransactionalLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapTransactionalPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapTransactionalLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapTransactionalPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
+
return suite;
}
}
[19/23] incubator-ignite git commit: # Minor fix to IGFS secondary
file system arguments validation.
Posted by ak...@apache.org.
# Minor fix to IGFS secondary file system arguments validation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c4611b83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c4611b83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c4611b83
Branch: refs/heads/ignite-593
Commit: c4611b83aeaf67f51b7ef9959e20a233a3883e00
Parents: d173f37
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Apr 3 12:08:21 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Apr 3 12:08:21 2015 +0300
----------------------------------------------------------------------
.../ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c4611b83/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index 13a2173..ba891f8 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -83,6 +83,9 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
if (F.isEmpty(uri))
uri = null;
+ if (F.isEmpty(cfgPath))
+ cfgPath = null;
+
if (F.isEmpty(userName))
userName = null;
[05/23] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-3' into ignite-645
Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-645
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7f69f2ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7f69f2ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7f69f2ae
Branch: refs/heads/ignite-593
Commit: 7f69f2aee4251e0a78ca563c5fc8fd139f875e3f
Parents: dfb4679 ed6632a
Author: sboikov <se...@inria.fr>
Authored: Wed Apr 1 22:54:21 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Wed Apr 1 22:54:21 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 19 +-
examples/schema-import/pom.xml | 10 +-
.../examples/datagrid/CacheQueryExample.java | 12 +-
modules/aop/pom.xml | 6 +-
modules/aws/pom.xml | 4 +-
modules/clients/pom.xml | 10 +-
modules/codegen/pom.xml | 4 +-
modules/core/pom.xml | 8 +-
.../apache/ignite/cache/CachingProvider.java | 2 +-
.../store/jdbc/CacheAbstractJdbcStore.java | 2 +-
.../cache/store/jdbc/CacheJdbcBlobStore.java | 9 +-
.../configuration/FileSystemConfiguration.java | 6 +
.../ignite/internal/GridCachePluginContext.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 5 +-
.../cache/CacheObjectByteArrayImpl.java | 2 +-
.../processors/cache/CacheObjectContext.java | 14 +-
.../processors/cache/CacheObjectImpl.java | 10 +-
.../cache/DynamicCacheDescriptor.java | 2 +-
.../processors/cache/GridCacheAdapter.java | 4 +-
.../processors/cache/GridCacheMapEntry.java | 2 +-
.../processors/cache/GridCacheProcessor.java | 66 ++--
.../cache/query/GridCacheQueryManager.java | 16 +-
.../continuous/CacheContinuousQueryManager.java | 28 ++
.../IgniteCacheObjectProcessorImpl.java | 173 +++++++----
.../processors/igfs/IgfsDataManager.java | 11 +-
.../processors/igfs/IgfsFileAffinityRange.java | 23 +-
.../processors/igfs/IgfsHelperImpl.java | 3 +-
.../processors/plugin/CachePluginManager.java | 2 +-
.../ignite/plugin/CachePluginConfiguration.java | 5 +-
.../ignite/plugin/CachePluginContext.java | 2 +-
.../ignite/plugin/CachePluginProvider.java | 3 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 9 +-
.../ignite/startup/BasicWarmupClosure.java | 2 +-
.../IgniteCacheAtomicLocalStoreValueTest.java | 49 +++
...iteCacheAtomicNearEnabledStoreValueTest.java | 30 ++
...maryWriteOrderNearEnabledStoreValueTest.java | 31 ++
...heAtomicPrimaryWriteOrderStoreValueTest.java | 32 ++
.../cache/IgniteCacheAtomicStoreValueTest.java | 55 ++++
.../IgniteCacheStoreValueAbstractTest.java | 311 +++++++++++++++++++
.../cache/IgniteCacheTxLocalStoreValueTest.java | 49 +++
.../IgniteCacheTxNearEnabledStoreValueTest.java | 30 ++
.../cache/IgniteCacheTxStoreValueTest.java | 49 +++
...IgniteCacheJdbcBlobStoreNodeRestartTest.java | 52 ++++
...IgniteCacheStoreNodeRestartAbstractTest.java | 116 +++++++
.../junits/common/GridCommonAbstractTest.java | 2 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 11 +
modules/extdata/p2p/pom.xml | 4 +-
modules/extdata/uri/pom.xml | 4 +-
modules/geospatial/pom.xml | 4 +-
modules/hadoop/pom.xml | 8 +-
modules/hibernate/pom.xml | 6 +-
.../hibernate/CacheHibernateBlobStore.java | 9 +-
.../CacheHibernateBlobStoreNodeRestartTest.java | 52 ++++
.../testsuites/IgniteHibernateTestSuite.java | 2 +
modules/indexing/pom.xml | 4 +-
.../processors/query/h2/IgniteH2Indexing.java | 4 +-
modules/jcl/pom.xml | 4 +-
modules/jta/pom.xml | 4 +-
modules/log4j/pom.xml | 4 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 10 +-
modules/schedule/pom.xml | 4 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 8 +-
modules/ssh/pom.xml | 8 +-
.../ant/beautifier/GridJavadocAntTask.java | 8 +-
modules/urideploy/pom.xml | 6 +-
modules/visor-console/pom.xml | 8 +-
.../scala/org/apache/ignite/visor/visor.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 8 +-
modules/yardstick/pom.xml | 6 +-
pom.xml | 56 ++--
74 files changed, 1249 insertions(+), 285 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f69f2ae/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f69f2ae/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f69f2ae/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
[17/23] incubator-ignite git commit: # Fixed JavaDoc issue.
Posted by ak...@apache.org.
# Fixed JavaDoc issue.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d173f370
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d173f370
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d173f370
Branch: refs/heads/ignite-593
Commit: d173f370e9eb6c0707d76aba11c293643837e0d5
Parents: d33191c
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Apr 3 11:09:25 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Apr 3 11:09:25 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/cache/local/GridLocalCacheEntry.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d173f370/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
index d05d1bb..84d4c90 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
@@ -35,7 +35,6 @@ public class GridLocalCacheEntry extends GridCacheMapEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
public GridLocalCacheEntry(GridCacheContext ctx,
[07/23] incubator-ignite git commit: # ignite-645
Posted by ak...@apache.org.
# ignite-645
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ef095dc6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ef095dc6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ef095dc6
Branch: refs/heads/ignite-593
Commit: ef095dc64346ad8c9d3a641e8d1554bb18e97a11
Parents: 282e8a5
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 2 09:48:35 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 2 09:48:35 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheEntryEx.java | 13 -------
.../processors/cache/GridCacheMapEntry.java | 36 --------------------
.../processors/cache/GridCacheTestEntryEx.java | 9 -----
3 files changed, 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef095dc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index c0f1d35..52b6a38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -595,19 +595,6 @@ public interface GridCacheEntryEx {
throws GridCacheEntryRemovedException, IgniteCheckedException;
/**
- * This method overwrites current in-memory value with new value.
- * <p>
- * Note that this method is non-transactional and non-distributed and should almost
- * never be used. It is meant to be used when fixing some heurisitic error state.
- *
- * @param val Value to set.
- * @return Previous value.
- * @throws IgniteCheckedException If poke operation failed.
- * @throws GridCacheEntryRemovedException if entry was unexpectedly removed.
- */
- public CacheObject poke(CacheObject val) throws GridCacheEntryRemovedException, IgniteCheckedException;
-
- /**
* Sets new value if current version is <tt>0</tt>
*
* @param val New value.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef095dc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 45fbced..11ee7d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2800,42 +2800,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
return peek(heap, offheap, swap, topVer, plc);
}
- /** {@inheritDoc} */
- @Override public CacheObject poke(CacheObject val) throws GridCacheEntryRemovedException, IgniteCheckedException {
- assert val != null;
-
- CacheObject old;
-
- synchronized (this) {
- checkObsolete();
-
- if (isNew() || !valid(AffinityTopologyVersion.NONE))
- unswap(true);
-
- if (deletedUnlocked())
- return null;
-
- old = rawGetOrUnmarshalUnlocked(false);
-
- GridCacheVersion nextVer = nextVersion();
-
- // Update index inside synchronization since it can be updated
- // in load methods without actually holding entry lock.
- long expireTime = expireTimeExtras();
-
- val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
-
- updateIndex(val, expireTime, nextVer, old);
-
- update(val, expireTime, ttlExtras(), nextVer);
- }
-
- if (log.isDebugEnabled())
- log.debug("Poked cache entry [newVal=" + val + ", oldVal=" + old + ", entry=" + this + ']');
-
- return old;
- }
-
/**
* Checks that entries in group locks transactions are not locked during commit.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef095dc6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
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 9bdde1b..a21fea5 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
@@ -606,15 +606,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
return ver;
}
- /** {@inheritDoc} */
- @Override public CacheObject poke(CacheObject val) throws GridCacheEntryRemovedException, IgniteCheckedException {
- CacheObject old = this.val;
-
- this.val = val;
-
- return old;
- }
-
/** @inheritDoc */
@Override public boolean initialValue(
CacheObject val,
[08/23] incubator-ignite git commit: # ignite-670 removed defaultTtl
from configuration
Posted by ak...@apache.org.
# ignite-670 removed defaultTtl from configuration
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/93912fef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/93912fef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/93912fef
Branch: refs/heads/ignite-593
Commit: 93912fefab66605c2cbca4447753385b07c9cb1a
Parents: fd51341
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 2 15:22:47 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 2 15:22:47 2015 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 29 -----------
.../processors/cache/GridCacheAdapter.java | 3 +-
.../processors/cache/GridCacheAttributes.java | 8 ---
.../cache/GridCacheConcurrentMap.java | 34 +++++--------
.../processors/cache/GridCacheMapEntry.java | 28 ++++++-----
.../cache/GridCacheMapEntryFactory.java | 2 -
.../processors/cache/GridCacheProcessor.java | 3 --
.../distributed/GridDistributedCacheEntry.java | 4 +-
.../distributed/dht/GridDhtCacheAdapter.java | 16 ++++--
.../distributed/dht/GridDhtCacheEntry.java | 4 +-
.../distributed/dht/GridNoStorageCacheMap.java | 11 +++--
.../dht/atomic/GridDhtAtomicCache.java | 3 +-
.../dht/atomic/GridDhtAtomicCacheEntry.java | 4 +-
.../dht/colocated/GridDhtColocatedCache.java | 5 +-
.../colocated/GridDhtColocatedCacheEntry.java | 4 +-
.../colocated/GridDhtDetachedCacheEntry.java | 5 +-
.../distributed/near/GridNearCacheAdapter.java | 3 +-
.../distributed/near/GridNearCacheEntry.java | 4 +-
.../processors/cache/local/GridLocalCache.java | 3 +-
.../cache/local/GridLocalCacheEntry.java | 3 +-
.../local/atomic/GridLocalAtomicCache.java | 3 +-
.../cache/VisorCacheDefaultConfiguration.java | 11 -----
...idCacheConfigurationConsistencySelfTest.java | 3 --
.../GridCacheDhtEvictionsDisabledSelfTest.java | 8 +--
.../distributed/dht/GridCacheDhtTestUtils.java | 2 +-
.../loadtests/hashmap/GridHashMapLoadTest.java | 2 +-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 5 +-
.../IgniteCacheWithIndexingTestSuite.java | 51 ++++++++++++++++++++
.../IgniteH2IndexingSpiTestSuite.java | 18 -------
.../commands/cache/VisorCacheCommand.scala | 1 -
30 files changed, 121 insertions(+), 159 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 8d5ba6c..22148ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -63,12 +63,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Time in milliseconds to wait between rebalance messages to avoid overloading CPU. */
public static final long DFLT_REBALANCE_THROTTLE = 0;
- /**
- * Default time to live. The value is <tt>0</tt> which means that
- * cached objects never expire based on time.
- */
- public static final long DFLT_TIME_TO_LIVE = 0;
-
/** Default number of backups. */
public static final int DFLT_BACKUPS = 0;
@@ -180,9 +174,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Rebalance timeout. */
private long rebalanceTimeout = DFLT_REBALANCE_TIMEOUT;
- /** Default time to live for cache entries. */
- private long ttl = DFLT_TIME_TO_LIVE;
-
/** Cache expiration policy. */
private EvictionPolicy evictPlc;
@@ -405,7 +396,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
storeFactory = cc.getCacheStoreFactory();
swapEnabled = cc.isSwapEnabled();
tmLookupClsName = cc.getTransactionManagerLookupClassName();
- ttl = cc.getDefaultTimeToLive();
typeMeta = cc.getTypeMetadata();
writeBehindBatchSize = cc.getWriteBehindBatchSize();
writeBehindEnabled = cc.isWriteBehindEnabled();
@@ -439,25 +429,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
}
/**
- * Gets time to live for all objects in cache. This value can be overridden for individual objects.
- * If not set, then value is {@code 0} which means that objects never expire.
- *
- * @return Time to live for all objects in cache.
- */
- public long getDefaultTimeToLive() {
- return ttl;
- }
-
- /**
- * Sets time to live for all objects in cache. This value can be override for individual objects.
- *
- * @param ttl Time to live for all objects in cache.
- */
- public void setDefaultTimeToLive(long ttl) {
- this.ttl = ttl;
- }
-
- /**
* Gets cache eviction policy. By default, returns {@code null}
* which means that evictions are disabled for cache.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index eb1a98f..1d53444 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1121,8 +1121,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
*/
@Nullable private GridCacheEntryEx entry0(KeyCacheObject key, AffinityTopologyVersion topVer, boolean create,
boolean touch) {
- GridTriple<GridCacheMapEntry> t = map.putEntryIfObsoleteOrAbsent(topVer, key, null,
- ctx.config().getDefaultTimeToLive(), create);
+ GridTriple<GridCacheMapEntry> t = map.putEntryIfObsoleteOrAbsent(topVer, key, null, create);
GridCacheEntryEx cur = t.get1();
GridCacheEntryEx created = t.get2();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index 496817e..755b89a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -198,14 +198,6 @@ public class GridCacheAttributes implements Serializable {
return ccfg.isSwapEnabled();
}
-
- /**
- * @return Default time to live for cache entries.
- */
- public long defaultTimeToLive() {
- return ccfg.getDefaultTimeToLive();
- }
-
/**
* @return Flag indicating whether eviction is synchronized.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index f45d00e..5e9c2da 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -461,24 +461,22 @@ public class GridCacheConcurrentMap {
* @param topVer Topology version.
* @param key Key.
* @param val Value.
- * @param ttl Time to live.
* @return Cache entry for corresponding key-value pair.
*/
- public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer, KeyCacheObject key, @Nullable CacheObject val, long ttl) {
+ public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer, KeyCacheObject key, @Nullable CacheObject val) {
assert key != null;
checkWeakQueue();
int hash = hash(key.hashCode());
- return segmentFor(hash).put(key, hash, val, topVer, ttl);
+ return segmentFor(hash).put(key, hash, val, topVer);
}
/**
* @param topVer Topology version.
* @param key Key.
* @param val Value.
- * @param ttl Time to live.
* @param create Create flag.
* @return Triple where the first element is current entry associated with the key,
* the second is created entry and the third is doomed (all may be null).
@@ -487,7 +485,6 @@ public class GridCacheConcurrentMap {
AffinityTopologyVersion topVer,
KeyCacheObject key,
@Nullable CacheObject val,
- long ttl,
boolean create)
{
assert key != null;
@@ -496,7 +493,7 @@ public class GridCacheConcurrentMap {
int hash = hash(key.hashCode());
- return segmentFor(hash).putIfObsolete(key, hash, val, topVer, ttl, create);
+ return segmentFor(hash).putIfObsolete(key, hash, val, topVer, create);
}
/**
@@ -505,12 +502,11 @@ public class GridCacheConcurrentMap {
* this map had for any of the keys currently in the specified map.
*
* @param m mappings to be stored in this map.
- * @param ttl Time to live.
* @throws NullPointerException If the specified map is null.
*/
- public void putAll(Map<KeyCacheObject, CacheObject> m, long ttl) {
+ public void putAll(Map<KeyCacheObject, CacheObject> m) {
for (Map.Entry<KeyCacheObject, CacheObject> e : m.entrySet())
- putEntry(AffinityTopologyVersion.NONE, e.getKey(), e.getValue(), ttl);
+ putEntry(AffinityTopologyVersion.NONE, e.getKey(), e.getValue());
}
/**
@@ -896,15 +892,14 @@ public class GridCacheConcurrentMap {
* @param hash Hash.
* @param val Value.
* @param topVer Topology version.
- * @param ttl TTL.
* @return Associated value.
*/
@SuppressWarnings({"unchecked"})
- GridCacheMapEntry put(KeyCacheObject key, int hash, @Nullable CacheObject val, AffinityTopologyVersion topVer, long ttl) {
+ GridCacheMapEntry put(KeyCacheObject key, int hash, @Nullable CacheObject val, AffinityTopologyVersion topVer) {
lock();
try {
- return put0(key, hash, val, topVer, ttl);
+ return put0(key, hash, val, topVer);
}
finally {
unlock();
@@ -916,11 +911,10 @@ public class GridCacheConcurrentMap {
* @param hash Hash.
* @param val Value.
* @param topVer Topology version.
- * @param ttl TTL.
* @return Associated value.
*/
@SuppressWarnings({"unchecked", "SynchronizationOnLocalVariableOrMethodParameter"})
- private GridCacheMapEntry put0(KeyCacheObject key, int hash, CacheObject val, AffinityTopologyVersion topVer, long ttl) {
+ private GridCacheMapEntry put0(KeyCacheObject key, int hash, CacheObject val, AffinityTopologyVersion topVer) {
try {
SegmentHeader hdr = this.hdr;
@@ -950,12 +944,12 @@ public class GridCacheConcurrentMap {
if (e != null) {
retVal = e;
- e.rawPut(val, ttl);
+ e.rawPut(val, 0);
}
else {
GridCacheMapEntry next = bin != null ? bin : null;
- GridCacheMapEntry newRoot = factory.create(ctx, topVer, key, hash, val, next, ttl, hdr.id());
+ GridCacheMapEntry newRoot = factory.create(ctx, topVer, key, hash, val, next, hdr.id());
// Avoiding delete (decrement) before creation (increment).
synchronized (newRoot) {
@@ -989,7 +983,6 @@ public class GridCacheConcurrentMap {
* @param hash Hash.
* @param val Value.
* @param topVer Topology version.
- * @param ttl TTL.
* @param create Create flag.
* @return Triple where the first element is current entry associated with the key,
* the second is created entry and the third is doomed (all may be null).
@@ -999,7 +992,6 @@ public class GridCacheConcurrentMap {
int hash,
@Nullable CacheObject val,
AffinityTopologyVersion topVer,
- long ttl,
boolean create)
{
lock();
@@ -1021,7 +1013,7 @@ public class GridCacheConcurrentMap {
if (bin == null) {
if (create)
- cur = created = put0(key, hash, val, topVer, ttl);
+ cur = created = put0(key, hash, val, topVer);
return new GridTriple<>(cur, created, doomed);
}
@@ -1036,13 +1028,13 @@ public class GridCacheConcurrentMap {
doomed = remove(key, hash, null);
if (create)
- cur = created = put0(key, hash, val, topVer, ttl);
+ cur = created = put0(key, hash, val, topVer);
}
else
cur = e;
}
else if (create)
- cur = created = put0(key, hash, val, topVer, ttl);
+ cur = created = put0(key, hash, val, topVer);
return new GridTriple<>(cur, created, doomed);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 58ff57f..78045d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -139,7 +139,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
protected GridCacheMapEntry(GridCacheContext<?, ?> cctx,
@@ -147,7 +146,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
if (log == null)
@@ -161,8 +159,6 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
this.hash = hash;
this.cctx = cctx;
- ttlAndExpireTimeExtras(ttl, CU.toExpireTime(ttl));
-
val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
synchronized (this) {
@@ -3515,19 +3511,25 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
boolean expired = checkExpired();
if (expired) {
- if (cctx.deferredDelete() && !detached() && !isInternal()) {
- if (!deletedUnlocked()) {
- update(null, 0L, 0L, ver);
+ if (!obsolete()) {
+ if (cctx.deferredDelete() && !detached() && !isInternal()) {
+ if (!deletedUnlocked()) {
+ update(null, 0L, 0L, ver);
- deletedUnlocked(true);
+ deletedUnlocked(true);
- deferred = true;
+ deferred = true;
+ }
+ }
+ else {
+ if (markObsolete0(obsoleteVer, true))
+ obsolete = true; // Success, will return "true".
}
}
- else {
- if (markObsolete0(obsoleteVer, true))
- obsolete = true; // Success, will return "true".
- }
+
+ clearIndex(saveValueForIndexUnlocked());
+
+ releaseSwap();
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_EXPIRED)) {
cctx.events().addEvent(partition(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
index 1e56674..2c7c28d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntryFactory.java
@@ -31,7 +31,6 @@ public interface GridCacheMapEntryFactory {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
* @return New cache entry.
*/
@@ -41,6 +40,5 @@ public interface GridCacheMapEntryFactory {
int hash,
CacheObject val,
@Nullable GridCacheMapEntry next,
- long ttl,
int hdrId);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 00852fc..91c35f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1967,9 +1967,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultLockTimeout",
"Default lock timeout", locAttr.defaultLockTimeout(), rmtAttr.defaultLockTimeout(), false);
- CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultTimeToLive",
- "Default time to live", locAttr.defaultTimeToLive(), rmtAttr.defaultTimeToLive(), false);
-
CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "preloadBatchSize",
"Preload batch size", locAttr.rebalanceBatchSize(), rmtAttr.rebalanceBatchSize(), false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
index a1d83d5..0947a8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
@@ -42,7 +42,6 @@ public class GridDistributedCacheEntry extends GridCacheMapEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Cache map header ID.
*/
public GridDistributedCacheEntry(GridCacheContext ctx,
@@ -50,10 +49,9 @@ public class GridDistributedCacheEntry extends GridCacheMapEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- super(ctx, key, hash, val, next, ttl, hdrId);
+ super(ctx, key, hash, val, next, hdrId);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 6c27566..5594feb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -94,9 +94,15 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
@Override protected void init() {
map.setEntryFactory(new GridCacheMapEntryFactory() {
/** {@inheritDoc} */
- @Override public GridCacheMapEntry create(GridCacheContext ctx, AffinityTopologyVersion topVer, KeyCacheObject key, int hash,
- CacheObject val, GridCacheMapEntry next, long ttl, int hdrId) {
- return new GridDhtCacheEntry(ctx, topVer, key, hash, val, next, ttl, hdrId);
+ @Override public GridCacheMapEntry create(GridCacheContext ctx,
+ AffinityTopologyVersion topVer,
+ KeyCacheObject key,
+ int hash,
+ CacheObject val,
+ GridCacheMapEntry next,
+ int hdrId)
+ {
+ return new GridDhtCacheEntry(ctx, topVer, key, hash, val, next, hdrId);
}
});
}
@@ -346,14 +352,14 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
public GridCacheEntryEx entryExx(KeyCacheObject key, AffinityTopologyVersion topVer, boolean allowDetached, boolean touch) {
try {
return allowDetached && !ctx.affinity().localNode(key, topVer) ?
- new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0, 0) :
+ new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0) :
entryEx(key, touch);
}
catch (GridDhtInvalidPartitionException e) {
if (!allowDetached)
throw e;
- return new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0, 0);
+ return new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index 7195d1c..35ac08b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -63,7 +63,6 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
public GridDhtCacheEntry(GridCacheContext ctx,
@@ -72,10 +71,9 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- super(ctx, key, hash, val, next, ttl, hdrId);
+ super(ctx, key, hash, val, next, hdrId);
// Record this entry with partition.
locPart = ctx.dht().topology().onAdded(topVer, this);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
index 7bcc5c3..8da4da5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridNoStorageCacheMap.java
@@ -71,7 +71,10 @@ public class GridNoStorageCacheMap extends GridCacheConcurrentMap {
}
/** {@inheritDoc} */
- @Override public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer, KeyCacheObject key, @Nullable CacheObject val, long ttl) {
+ @Override public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer,
+ KeyCacheObject key,
+ @Nullable CacheObject val)
+ {
throw new AssertionError();
}
@@ -80,12 +83,10 @@ public class GridNoStorageCacheMap extends GridCacheConcurrentMap {
AffinityTopologyVersion topVer,
KeyCacheObject key,
@Nullable CacheObject val,
- long ttl,
boolean create)
{
if (create) {
- GridCacheMapEntry entry = new GridDhtCacheEntry(ctx, topVer, key, hash(key.hashCode()), val,
- null, 0, 0);
+ GridCacheMapEntry entry = new GridDhtCacheEntry(ctx, topVer, key, hash(key.hashCode()), val, null, 0);
return new GridTriple<>(entry, null, null);
}
@@ -94,7 +95,7 @@ public class GridNoStorageCacheMap extends GridCacheConcurrentMap {
}
/** {@inheritDoc} */
- @Override public void putAll(Map<KeyCacheObject, CacheObject> m, long ttl) {
+ @Override public void putAll(Map<KeyCacheObject, CacheObject> m) {
throw new AssertionError();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index c376fa0..6e7c17f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -133,10 +133,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- return new GridDhtAtomicCacheEntry(ctx, topVer, key, hash, val, next, ttl, hdrId);
+ return new GridDhtAtomicCacheEntry(ctx, topVer, key, hash, val, next, hdrId);
}
});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
index c918e1e..9ded1f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCacheEntry.java
@@ -33,7 +33,6 @@ public class GridDhtAtomicCacheEntry extends GridDhtCacheEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
public GridDhtAtomicCacheEntry(GridCacheContext ctx,
@@ -42,10 +41,9 @@ public class GridDhtAtomicCacheEntry extends GridDhtCacheEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- super(ctx, topVer, key, hash, val, next, ttl, hdrId);
+ super(ctx, topVer, key, hash, val, next, hdrId);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index eb6d9a6..77224ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -87,10 +87,9 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, val, next, ttl, hdrId);
+ return new GridDhtColocatedCacheEntry(ctx, topVer, key, hash, val, next, hdrId);
}
});
}
@@ -130,7 +129,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
boolean allowDetached
) {
return allowDetached && !ctx.affinity().primary(ctx.localNode(), key, topVer) ?
- new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0, 0) : entryExx(key, topVer);
+ new GridDhtDetachedCacheEntry(ctx, key, key.hashCode(), null, null, 0) : entryExx(key, topVer);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
index 1ccc0da..fab9605 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCacheEntry.java
@@ -33,7 +33,6 @@ public class GridDhtColocatedCacheEntry extends GridDhtCacheEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
public GridDhtColocatedCacheEntry(GridCacheContext ctx,
@@ -42,10 +41,9 @@ public class GridDhtColocatedCacheEntry extends GridDhtCacheEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId
) {
- super(ctx, topVer, key, hash, val, next, ttl, hdrId);
+ super(ctx, topVer, key, hash, val, next, hdrId);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
index 77547db..5c4dd13 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
@@ -34,12 +34,11 @@ public class GridDhtDetachedCacheEntry extends GridDistributedCacheEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header ID.
*/
public GridDhtDetachedCacheEntry(GridCacheContext ctx, KeyCacheObject key, int hash, CacheObject val,
- GridCacheMapEntry next, long ttl, int hdrId) {
- super(ctx, key, hash, val, next, ttl, hdrId);
+ GridCacheMapEntry next, int hdrId) {
+ super(ctx, key, hash, val, next, hdrId);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 75c8978..846efff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -75,12 +75,11 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId
) {
// Can't hold any locks here - this method is invoked when
// holding write-lock on the whole cache map.
- return new GridNearCacheEntry(ctx, key, hash, val, next, ttl, hdrId);
+ return new GridNearCacheEntry(ctx, key, hash, val, next, hdrId);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index ce80ad9..13089aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -58,7 +58,6 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
* @param hash Key hash value.
* @param val Entry value.
* @param next Next entry in the linked list.
- * @param ttl Time to live.
* @param hdrId Header id.
*/
public GridNearCacheEntry(GridCacheContext ctx,
@@ -66,10 +65,9 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- super(ctx, key, hash, val, next, ttl, hdrId);
+ super(ctx, key, hash, val, next, hdrId);
part = ctx.affinity().partition(key);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
index 272dca6..5780144 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
@@ -79,10 +79,9 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId
) {
- return new GridLocalCacheEntry(ctx, key, hash, val, next, ttl, hdrId);
+ return new GridLocalCacheEntry(ctx, key, hash, val, next, hdrId);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
index db8038d..d05d1bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
@@ -43,10 +43,9 @@ public class GridLocalCacheEntry extends GridCacheMapEntry {
int hash,
CacheObject val,
GridCacheMapEntry next,
- long ttl,
int hdrId)
{
- super(ctx, key, hash, val, next, ttl, hdrId);
+ super(ctx, key, hash, val, next, hdrId);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index a9a6f23..d276501 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -81,10 +81,9 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
int hash,
CacheObject val,
@Nullable GridCacheMapEntry next,
- long ttl,
int hdrId
) {
- return new GridLocalCacheEntry(ctx, key, hash, val, next, ttl, hdrId);
+ return new GridLocalCacheEntry(ctx, key, hash, val, next, hdrId);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
index 858ba75..a0d9990 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheDefaultConfiguration.java
@@ -29,9 +29,6 @@ public class VisorCacheDefaultConfiguration implements Serializable {
/** */
private static final long serialVersionUID = 0L;
- /** TTL value. */
- private long ttl;
-
/** Default transaction timeout. */
private long txLockTimeout;
@@ -45,20 +42,12 @@ public class VisorCacheDefaultConfiguration implements Serializable {
public static VisorCacheDefaultConfiguration from(CacheConfiguration ccfg) {
VisorCacheDefaultConfiguration cfg = new VisorCacheDefaultConfiguration();
- cfg.ttl = ccfg.getDefaultTimeToLive();
cfg.txLockTimeout = ccfg.getDefaultLockTimeout();
return cfg;
}
/**
- * @return TTL value.
- */
- public long timeToLive() {
- return ttl;
- }
-
- /**
* @return Default transaction timeout.
*/
public long txLockTimeout() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 3737f46..44171a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -576,7 +576,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
/** {@inheritDoc} */
@Override public Void apply(CacheConfiguration cfg) {
cfg.setDefaultLockTimeout(1000);
- cfg.setDefaultTimeToLive(1000);
return null;
}
@@ -590,7 +589,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
/** {@inheritDoc} */
@Override public Void apply(CacheConfiguration cfg) {
cfg.setDefaultLockTimeout(2 * 1000);
- cfg.setDefaultTimeToLive(2 * 1000);
return null;
}
@@ -601,7 +599,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
String log = strLog.toString();
assertTrue(log.contains("Default lock timeout"));
- assertTrue(log.contains("Default time to live"));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
index c35f106..6662413 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -26,6 +25,8 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.junits.common.*;
import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
/**
* Test cache closure execution.
@@ -54,9 +55,8 @@ public class GridCacheDhtEvictionsDisabledSelfTest extends GridCommonAbstractTes
CacheConfiguration cc = defaultCacheConfiguration();
cc.setName("test");
- cc.setCacheMode(CacheMode.PARTITIONED);
- cc.setDefaultTimeToLive(0);
- cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ cc.setCacheMode(PARTITIONED);
+ cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setNearConfiguration(null);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
index 51a3d1c..765fd0e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
@@ -71,7 +71,7 @@ public class GridCacheDhtTestUtils {
for (int i = 0; i < keyCnt; i++) {
KeyCacheObject cacheKey = ctx.toCacheKeyObject(i);
- cacheMap.putEntry(AffinityTopologyVersion.NONE, cacheKey, ctx.toCacheKeyObject("value" + i), 0);
+ cacheMap.putEntry(AffinityTopologyVersion.NONE, cacheKey, ctx.toCacheKeyObject("value" + i));
dht.preloader().request(Collections.singleton(cacheKey), AffinityTopologyVersion.NONE);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
index 00ee851..de85025 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridHashMapLoadTest.java
@@ -80,7 +80,7 @@ public class GridHashMapLoadTest extends GridCommonAbstractTest {
Integer val = i++;
map.put(key, new GridCacheMapEntry(ctx, ctx.toCacheKeyObject(key),
- key.hashCode(), ctx.toCacheObject(val), null, 0, 1) {
+ key.hashCode(), ctx.toCacheObject(val), null, 1) {
@Override public boolean tmLock(IgniteInternalTx tx, long timeout) {
return false;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index 552e2ea..ebe6f16 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.junits.common.*;
+import javax.cache.configuration.*;
import javax.cache.expiry.*;
import java.util.*;
@@ -58,10 +59,12 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
cache.setAtomicityMode(atomicityMode());
cache.setMemoryMode(memoryMode());
cache.setOffHeapMaxMemory(0);
- cache.setDefaultTimeToLive(DEFAULT_TIME_TO_LIVE);
cache.setEvictionPolicy(new LruEvictionPolicy(MAX_CACHE_SIZE));
cache.setIndexedTypes(Integer.class, Integer.class);
+ cache.setExpiryPolicyFactory(
+ FactoryBuilder.factoryOf(new TouchedExpiryPolicy(new Duration(MILLISECONDS, DEFAULT_TIME_TO_LIVE))));
+
cfg.setCacheConfiguration(cache);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
new file mode 100644
index 0000000..ba6fe36
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.ttl.*;
+
+/**
+ * Cache tests using indexing.
+ */
+public class IgniteCacheWithIndexingTestSuite extends TestSuite {
+ /**
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Ignite Cache With Indexing Test Suite");
+
+ suite.addTestSuite(GridCacheOffHeapAndSwapSelfTest.class);
+ suite.addTestSuite(GridIndexingWithNoopSwapSelfTest.class);
+ suite.addTestSuite(GridCacheSwapSelfTest.class);
+ suite.addTestSuite(GridCacheOffHeapSelfTest.class);
+
+ suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapTransactionalLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOffheapTransactionalPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapTransactionalLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapTransactionalPartitionedSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
+ suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
index 21076bd..3aff923 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteH2IndexingSpiTestSuite.java
@@ -18,8 +18,6 @@
package org.apache.ignite.testsuites;
import junit.framework.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.ttl.*;
import org.apache.ignite.internal.processors.query.h2.*;
import org.apache.ignite.internal.processors.query.h2.opt.*;
@@ -46,22 +44,6 @@ public class IgniteH2IndexingSpiTestSuite extends TestSuite {
// Index rebuilding.
suite.addTest(new TestSuite(GridH2IndexRebuildTest.class));
- // Tests moved to this suite since they require GridH2IndexingSpi.
- suite.addTestSuite(GridCacheOffHeapAndSwapSelfTest.class);
- suite.addTestSuite(GridIndexingWithNoopSwapSelfTest.class);
- suite.addTestSuite(GridCacheSwapSelfTest.class);
- suite.addTestSuite(GridCacheOffHeapSelfTest.class);
-
- //ttl
- suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
- suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);
- suite.addTestSuite(CacheTtlOffheapTransactionalLocalSelfTest.class);
- suite.addTestSuite(CacheTtlOffheapTransactionalPartitionedSelfTest.class);
- suite.addTestSuite(CacheTtlOnheapTransactionalLocalSelfTest.class);
- suite.addTestSuite(CacheTtlOnheapTransactionalPartitionedSelfTest.class);
- suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class);
- suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/93912fef/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index eb6e040..4365364 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -766,7 +766,6 @@ object VisorCacheCommand {
cacheT += ("Statistic Enabled", bool2Str(cfg.statisticsEnabled()))
cacheT += ("Management Enabled", bool2Str(cfg.managementEnabled()))
- cacheT += ("Time To Live", defaultCfg.timeToLive())
cacheT += ("Time To Live Eager Flag", cfg.eagerTtl)
cacheT += ("Write Synchronization Mode", safe(cfg.writeSynchronizationMode))
[11/23] incubator-ignite git commit: Merge branch 'ignite-sprint-3'
into ignite-645
Posted by ak...@apache.org.
Merge branch 'ignite-sprint-3' into ignite-645
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6a721d76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a721d76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a721d76
Branch: refs/heads/ignite-593
Commit: 6a721d76d7625a8c9bc645e785136fce4551c514
Parents: 07ed759 07ca9fa
Author: Andrey Gura <ag...@gridgain.com>
Authored: Thu Apr 2 15:26:10 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Thu Apr 2 15:26:10 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 2 +
examples/pom-standalone.xml | 1 -
ipc/shmem/README.txt | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 4 +-
.../visor/cache/VisorCacheConfiguration.java | 81 +++++--------
.../cache/VisorCacheNearConfiguration.java | 11 +-
.../visor/node/VisorGridConfiguration.java | 28 ++++-
.../internal/visor/util/VisorMimeTypes.java | 4 +-
.../resources/META-INF/classnames.properties | 79 ++++---------
.../ignite/IgniteCacheAffinitySelfTest.java | 2 +
.../GridCacheOnCopyFlagAbstractSelfTest.java | 16 +--
.../processors/igfs/IgsfStartCacheTest.java | 115 +++++++++++++++++++
.../GridUriDeploymentFileResourceLoader.java | 2 +-
parent/pom.xml | 10 +-
14 files changed, 230 insertions(+), 127 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a721d76/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
[21/23] incubator-ignite git commit: ignite-658
Posted by ak...@apache.org.
ignite-658
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/09a3a82b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/09a3a82b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/09a3a82b
Branch: refs/heads/ignite-593
Commit: 09a3a82b346c5b1f913941b4e3d27576787abbe4
Parents: adba7eb
Author: avinogradov <av...@gridgain.com>
Authored: Fri Apr 3 12:45:23 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri Apr 3 12:45:23 2015 +0300
----------------------------------------------------------------------
modules/core/pom.xml | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09a3a82b/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 5355e5a..466ccb9 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -270,14 +270,6 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <exec executable="${git.exec}" outputproperty="ignite.build">
- <arg line="log -1 --format=%ct" />
- </exec>
-
- <exec executable="${git.exec}" outputproperty="ignite.revision">
- <arg line="log -1 --format=%H" />
- </exec>
-
<tstamp>
<format property="ignite.rel.date" pattern="ddMMyyyy" locale="en" />
</tstamp>
@@ -285,28 +277,38 @@
<property name="props.file" value="../../modules/core/target/classes/ignite.properties" />
<replaceregexp file="${props.file}" byline="true">
- <regexp pattern="ignite.version=.*" />
- <substitution expression="ignite.version=${project.version}" />
+ <regexp pattern="ignite.rel.date=.*" />
+ <substitution expression="ignite.rel.date=${ignite.rel.date}" />
</replaceregexp>
<replaceregexp file="${props.file}" byline="true">
- <regexp pattern="ignite.build=.*" />
- <substitution expression="ignite.build=${ignite.build}" />
+ <regexp pattern="ignite.update.status.params=.*" />
+ <substitution expression="ignite.update.status.params=ver=${project.version}" />
</replaceregexp>
<replaceregexp file="${props.file}" byline="true">
- <regexp pattern="ignite.revision=.*" />
- <substitution expression="ignite.revision=${ignite.revision}" />
+ <regexp pattern="ignite.version=.*" />
+ <substitution expression="ignite.version=${project.version}" />
</replaceregexp>
+ <!-- git (to be replaced by git hooks)-->
+
+ <exec executable="${git.exec}" outputproperty="ignite.build" failonerror="true">
+ <arg line="log -1 --format=%ct" />
+ </exec>
+
+ <exec executable="${git.exec}" outputproperty="ignite.revision" failonerror="true">
+ <arg line="log -1 --format=%H" />
+ </exec>
+
<replaceregexp file="${props.file}" byline="true">
- <regexp pattern="ignite.rel.date=.*" />
- <substitution expression="ignite.rel.date=${ignite.rel.date}" />
+ <regexp pattern="ignite.revision=.*" />
+ <substitution expression="ignite.revision=${ignite.revision}" />
</replaceregexp>
<replaceregexp file="${props.file}" byline="true">
- <regexp pattern="ignite.update.status.params=.*" />
- <substitution expression="ignite.update.status.params=ver=${project.version}" />
+ <regexp pattern="ignite.build=.*" />
+ <substitution expression="ignite.build=${ignite.build}" />
</replaceregexp>
</target>
</configuration>