You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2015/04/04 00:45:53 UTC

[01/50] [abbrv] incubator-ignite git commit: ignite-645 Remove GridCachePeekMode

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-674 7e86251e8 -> 0e3e6d096


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.
         }


[06/50] [abbrv] incubator-ignite git commit: ignite-gg-10009: add tests to test suite.

Posted by ag...@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-674
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;
     }
 }


[16/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-gg-10009-2

Posted by ag...@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-674
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
----------------------------------------------------------------------


[03/50] [abbrv] incubator-ignite git commit: Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002

Posted by ag...@apache.org.
Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002


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

Branch: refs/heads/ignite-674
Commit: c9b3f21cff691150577937761b0d3530f5b687d5
Parents: d7dad48 091369c
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Apr 1 13:14:45 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Apr 1 13:14:45 2015 +0300

----------------------------------------------------------------------
 .../examples/datagrid/CacheQueryExample.java    |  12 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |  12 +-
 .../client/impl/ClientCacheFlagsCodecTest.java  |  18 +-
 .../configuration/CacheConfiguration.java       |  23 ++
 .../ignite/internal/GridCachePluginContext.java |  72 ++++
 .../ignite/internal/GridKernalContextImpl.java  |  17 +-
 .../org/apache/ignite/internal/IgniteEx.java    |   4 +-
 .../apache/ignite/internal/IgniteKernal.java    |  12 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  10 +-
 .../internal/MarshallerContextAdapter.java      |   6 +-
 .../ignite/internal/MarshallerContextImpl.java  |  90 ++++-
 .../internal/client/GridClientCacheFlag.java    |  13 -
 .../impl/connection/GridClientConnection.java   |   9 -
 .../internal/managers/GridManagerAdapter.java   |   4 +
 .../cache/CacheConflictResolutionManager.java   |  30 ++
 .../internal/processors/cache/CacheFlag.java    | 108 ------
 .../processors/cache/CacheFlagException.java    |  67 ----
 .../cache/CacheObjectByteArrayImpl.java         |   2 +-
 .../cache/CacheOsConflictResolutionManager.java |  58 +++
 .../processors/cache/CacheProjection.java       | 233 +-----------
 .../internal/processors/cache/GridCache.java    |   3 -
 .../processors/cache/GridCacheAdapter.java      | 271 +++-----------
 .../cache/GridCacheConcurrentMap.java           |  44 +--
 .../processors/cache/GridCacheContext.java      | 256 ++-----------
 .../processors/cache/GridCacheEntryEx.java      |   3 +-
 .../processors/cache/GridCacheMapEntry.java     |  27 +-
 .../processors/cache/GridCacheProcessor.java    |  66 ++--
 .../processors/cache/GridCacheProjectionEx.java |  29 --
 .../cache/GridCacheProjectionImpl.java          | 357 +++----------------
 .../processors/cache/GridCacheProxyImpl.java    |  55 +--
 .../cache/GridCacheSharedContext.java           |  21 --
 .../processors/cache/GridCacheUtils.java        |  39 ++
 .../processors/cache/IgniteCacheProxy.java      |  31 +-
 .../CacheDataStructuresManager.java             |   4 +-
 .../GridDistributedTxRemoteAdapter.java         |   2 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   2 +-
 .../distributed/dht/GridDhtLocalPartition.java  |   2 +-
 .../distributed/dht/GridDhtLockFuture.java      |   2 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   2 +-
 .../dht/GridPartitionedGetFuture.java           |   3 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  32 --
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |   2 -
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   3 -
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  78 ++--
 .../dht/colocated/GridDhtColocatedCache.java    |   2 -
 .../colocated/GridDhtDetachedCacheEntry.java    |   2 +-
 .../distributed/near/GridNearAtomicCache.java   |   5 +-
 .../distributed/near/GridNearCacheAdapter.java  |   9 -
 .../distributed/near/GridNearGetFuture.java     |   3 +-
 .../near/GridNearTransactionalCache.java        |   2 -
 .../cache/distributed/near/GridNearTxLocal.java |   4 +-
 .../processors/cache/dr/GridCacheDrManager.java |   5 -
 .../cache/dr/GridOsCacheDrManager.java          | 106 ++++++
 .../cache/dr/os/GridOsCacheDrManager.java       | 111 ------
 .../local/atomic/GridLocalAtomicCache.java      |  74 +---
 .../cache/query/GridCacheQueriesImpl.java       |  23 +-
 .../continuous/CacheContinuousQueryHandler.java |   5 -
 .../CacheContinuousQueryListener.java           |   3 +
 .../continuous/CacheContinuousQueryManager.java |   2 +-
 .../transactions/IgniteTransactionsImpl.java    |   5 +-
 .../transactions/IgniteTxLocalAdapter.java      |  19 +-
 .../cache/transactions/IgniteTxManager.java     |   2 -
 .../version/CacheVersionConflictResolver.java   |  40 +++
 ...ridCacheVersionAbstractConflictResolver.java |  56 ---
 .../GridCacheVersionConflictResolver.java       |  59 ---
 .../datastreamer/DataStreamerImpl.java          |   2 +-
 .../datastructures/DataStructuresProcessor.java |  13 +-
 .../datastructures/GridCacheAtomicLongImpl.java |  14 +-
 .../GridCacheAtomicReferenceImpl.java           |   2 +-
 .../GridCacheAtomicReferenceValue.java          |  15 +-
 .../GridCacheAtomicSequenceImpl.java            |   2 +-
 .../GridCacheAtomicStampedImpl.java             |   2 +-
 .../GridCacheAtomicStampedValue.java            |  15 +-
 .../GridCacheCountDownLatchImpl.java            |   2 +-
 .../processors/plugin/CachePluginManager.java   | 107 ++++++
 .../handlers/cache/GridCacheCommandHandler.java |  66 ++--
 .../ignite/internal/util/IgniteUtils.java       |   2 +-
 .../ignite/marshaller/MarshallerContext.java    |   3 +-
 .../optimized/OptimizedMarshallerUtils.java     |   9 +-
 .../ignite/plugin/CachePluginConfiguration.java |  36 ++
 .../ignite/plugin/CachePluginContext.java       |  54 +++
 .../ignite/plugin/CachePluginProvider.java      |  84 +++++
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  16 +-
 .../org/apache/ignite/spi/IgniteSpiContext.java |   5 +
 .../communication/tcp/TcpCommunicationSpi.java  |  13 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  14 +-
 ...eJdbcStoreAbstractMultithreadedSelfTest.java |  11 +-
 .../GridProjectionForCachesSelfTest.java        |  12 +-
 .../managers/GridNoopManagerSelfTest.java       |   2 +-
 .../communication/GridIoManagerSelfTest.java    |   9 +-
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +-
 .../cache/GridCacheAbstractFlagsTest.java       |  97 -----
 .../cache/GridCacheAbstractFullApiSelfTest.java |  61 +++-
 .../cache/GridCacheMemoryModeSelfTest.java      |  12 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |  26 +-
 .../GridCacheReturnValueTransferSelfTest.java   |  36 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   2 +-
 .../cache/IgniteCacheInvokeAbstractTest.java    |  11 -
 ...PartitionedQueueCreateMultiNodeSelfTest.java |   6 +-
 .../IgniteCacheSystemTransactionsSelfTest.java  |  38 +-
 ...GridCacheValueConsistencyAtomicSelfTest.java | 101 ------
 .../near/GridCachePartitionedFlagsTest.java     |  41 ---
 ...achePartitionedMultiNodeFullApiSelfTest.java |   2 +
 .../GridCacheReplicatedFlagsTest.java           |  28 --
 ...ridCacheContinuousQueryAbstractSelfTest.java |   2 +-
 .../cache/GridCacheCommandHandlerSelfTest.java  |   2 +-
 .../GridServiceReassignmentSelfTest.java        |   5 +-
 .../internal/util/IgniteUtilsSelfTest.java      |   2 +-
 .../loadtests/hashmap/GridCacheTestContext.java |   8 +-
 .../OptimizedMarshallerNodeFailoverTest.java    |  71 +++-
 .../OptimizedObjectStreamSelfTest.java          |   4 -
 .../spi/GridSpiLocalHostInjectionTest.java      |   2 +-
 .../GridPriorityQueueCollisionSpiSelfTest.java  |   2 +-
 ...RobinLoadBalancingSpiNotPerTaskSelfTest.java |   2 +-
 .../testframework/GridSpiTestContext.java       |  18 +-
 .../testframework/junits/GridAbstractTest.java  |  28 +-
 .../junits/GridTestKernalContext.java           |   2 +-
 .../junits/IgniteTestResources.java             |   8 +-
 .../junits/spi/GridSpiAbstractTest.java         |  13 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 -
 .../hadoop/jobtracker/HadoopJobTracker.java     |   7 +-
 .../HadoopDefaultMapReducePlannerSelfTest.java  |   3 +-
 .../processors/cache/jta/CacheJtaManager.java   |   1 -
 .../ignite/scalar/pimps/ScalarCachePimp.scala   |  36 --
 .../ant/beautifier/GridJavadocAntTask.java      |   8 +-
 .../commands/disco/VisorDiscoveryCommand.scala  |   8 +-
 .../commands/events/VisorEventsCommand.scala    |  24 +-
 .../commands/tasks/VisorTasksCommand.scala      |   6 +-
 parent/pom.xml                                  |  38 +-
 131 files changed, 1454 insertions(+), 2501 deletions(-)
----------------------------------------------------------------------



[35/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 minor

Posted by ag...@apache.org.
# ignite-sprint-3 minor


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

Branch: refs/heads/ignite-674
Commit: d214c21e850de6d1a8b746985e23f9400bc3d224
Parents: d2d6def
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 16:33:40 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 16:33:40 2015 +0300

----------------------------------------------------------------------
 .../atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d214c21e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 1c507ca..1f63214 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -103,6 +103,11 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
         delay = false;
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
     /**
      * @throws Exception If failed.
      */


[48/50] [abbrv] incubator-ignite git commit: IGNITE-674 - Merging 6.6.4 fixes to Ignite.

Posted by ag...@apache.org.
IGNITE-674 - Merging 6.6.4 fixes to Ignite.


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

Branch: refs/heads/ignite-674
Commit: ab01e7dd37803a5a39b71d58429bccae79def1a4
Parents: 7e86251
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Apr 3 15:23:38 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Apr 3 15:23:38 2015 -0700

----------------------------------------------------------------------
 .../ignite/codegen/MessageCodeGenerator.java    |   1 -
 .../processors/cache/GridCacheContext.java      |  58 ++++-
 .../cache/GridCacheEvictionManager.java         |   6 +-
 .../cache/GridCacheExplicitLockSpan.java        |   2 +-
 .../processors/cache/GridCacheMapEntry.java     |  28 ++-
 .../processors/cache/GridCacheMvcc.java         |   2 +-
 .../cache/GridCacheMvccCandidate.java           |  50 ++++-
 .../processors/cache/GridCacheMvccManager.java  |  44 +++-
 .../distributed/GridDistributedCacheEntry.java  |  12 +-
 .../distributed/dht/GridDhtCacheEntry.java      |  31 ++-
 .../distributed/dht/GridDhtLockFuture.java      |  15 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |  14 +-
 .../distributed/dht/GridDhtTxFinishFuture.java  |  22 +-
 .../cache/distributed/dht/GridDhtTxLocal.java   |   2 +
 .../distributed/dht/GridDhtTxLocalAdapter.java  |  30 ++-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  28 ++-
 .../dht/colocated/GridDhtColocatedCache.java    |  32 ++-
 .../colocated/GridDhtColocatedLockFuture.java   |  46 +++-
 .../GridDhtPartitionsExchangeFuture.java        |  39 +++-
 .../distributed/near/GridNearCacheEntry.java    |  10 +-
 .../distributed/near/GridNearLockFuture.java    |  11 +-
 .../near/GridNearTxFinishFuture.java            |   8 +-
 .../cache/distributed/near/GridNearTxLocal.java |   7 +
 .../near/GridNearTxPrepareFuture.java           | 122 +++++++----
 .../near/GridNearTxPrepareRequest.java          |  64 ++++--
 .../cache/transactions/IgniteTxAdapter.java     |   3 +-
 .../cache/transactions/IgniteTxHandler.java     | 120 +++++++---
 .../transactions/IgniteTxLocalAdapter.java      |  76 ++++---
 .../cache/transactions/IgniteTxManager.java     |   7 +
 .../util/future/GridCompoundFuture.java         |   1 +
 .../internal/util/future/GridFutureAdapter.java |  18 +-
 .../ignite/internal/util/worker/GridWorker.java |   6 +-
 .../dht/IgniteCacheLockFailoverSelfTest.java    | 148 +++++++++++++
 .../dht/IgniteCacheMultiTxLockSelfTest.java     | 217 +++++++++++++++++++
 .../testframework/junits/GridAbstractTest.java  |   4 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   3 +
 36 files changed, 1052 insertions(+), 235 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
index 9551680..f75bcf4 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.codegen;
 
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.query.h2.twostep.messages.*;
 import org.apache.ignite.internal.processors.datastreamer.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index dfa82e6..6c3bd60 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -1416,6 +1416,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         UUID nearNodeId,
         AffinityTopologyVersion topVer,
         GridDhtCacheEntry entry,
+        GridCacheVersion explicitLockVer,
         IgniteLogger log,
         Map<ClusterNode, List<GridDhtCacheEntry>> dhtMap,
         @Nullable Map<ClusterNode, List<GridDhtCacheEntry>> nearMap
@@ -1431,6 +1432,8 @@ public class GridCacheContext<K, V> implements Externalizable {
 
         boolean ret = map(entry, dhtRemoteNodes, dhtMap);
 
+        Collection<ClusterNode> nearRemoteNodes = null;
+
         if (nearMap != null) {
             Collection<UUID> readers = entry.readers();
 
@@ -1445,8 +1448,21 @@ public class GridCacheContext<K, V> implements Externalizable {
             else if (log.isDebugEnabled())
                 log.debug("Entry has no near readers: " + entry);
 
-            if (nearNodes != null && !nearNodes.isEmpty())
-                ret |= map(entry, F.view(nearNodes, F.notIn(dhtNodes)), nearMap);
+            if (nearNodes != null && !nearNodes.isEmpty()) {
+                nearRemoteNodes = F.view(nearNodes, F.notIn(dhtNodes));
+
+                ret |= map(entry, nearRemoteNodes, nearMap);
+            }
+        }
+
+        if (explicitLockVer != null) {
+            Collection<ClusterNode> dhtNodeIds = new ArrayList<>(dhtRemoteNodes);
+            Collection<ClusterNode> nearNodeIds = F.isEmpty(nearRemoteNodes) ? null : new ArrayList<>(nearRemoteNodes);
+
+            if (!F.isEmpty(nearNodeIds))
+                U.dumpStack("Added near mapped nodes: " + entry + ", " + nearNodeIds);
+
+            entry.mappings(explicitLockVer, dhtNodeIds, nearNodeIds);
         }
 
         return ret;
@@ -1454,6 +1470,44 @@ public class GridCacheContext<K, V> implements Externalizable {
 
     /**
      * @param entry Entry.
+     * @param log Log.
+     * @param dhtMap Dht mappings.
+     * @param nearMap Near mappings.
+     * @return {@code True} if mapped.
+     * @throws GridCacheEntryRemovedException If reader for entry is removed.
+     */
+    public boolean dhtMap(
+        GridDhtCacheEntry entry,
+        GridCacheVersion explicitLockVer,
+        IgniteLogger log,
+        Map<ClusterNode, List<GridDhtCacheEntry>> dhtMap,
+        Map<ClusterNode, List<GridDhtCacheEntry>> nearMap
+    ) throws GridCacheEntryRemovedException {
+        assert explicitLockVer != null;
+
+        GridCacheMvccCandidate cand = entry.candidate(explicitLockVer);
+
+        if (cand != null) {
+            Collection<ClusterNode> dhtNodes = cand.mappedDhtNodes();
+
+            if (log.isDebugEnabled())
+                log.debug("Mapping explicit lock to DHT nodes [nodes=" + U.nodeIds(dhtNodes) + ", entry=" + entry + ']');
+
+            Collection<ClusterNode> nearNodes = cand.mappedNearNodes();
+
+            boolean ret = map(entry, dhtNodes, dhtMap);
+
+            if (nearNodes != null && !nearNodes.isEmpty())
+                ret |= map(entry, nearNodes, nearMap);
+
+            return ret;
+        }
+
+        return false;
+    }
+
+    /**
+     * @param entry Entry.
      * @param nodes Nodes.
      * @param map Map.
      * @return {@code True} if mapped.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index fd56568..b0c9243 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -253,11 +253,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
 
         if (plcEnabled && evictSync && !cctx.isNear()) {
             // Add dummy event to worker.
-            ClusterNode locNode = cctx.localNode();
-
-            DiscoveryEvent evt = new DiscoveryEvent(locNode, "Dummy event.", EVT_NODE_JOINED, locNode);
-
-            evt.topologySnapshot(locNode.order(), cctx.discovery().topology(locNode.order()));
+            DiscoveryEvent evt = cctx.discovery().localJoinEvent();
 
             backupWorker.addEvent(evt);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheExplicitLockSpan.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheExplicitLockSpan.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheExplicitLockSpan.java
index 242e769..0e555c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheExplicitLockSpan.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheExplicitLockSpan.java
@@ -45,7 +45,7 @@ public class GridCacheExplicitLockSpan extends ReentrantLock {
     private final Map<KeyCacheObject, Deque<GridCacheMvccCandidate>> cands = new HashMap<>();
 
     /** Span lock release future. */
-    @GridToStringInclude
+    @GridToStringExclude
     private final GridFutureAdapter<Object> releaseFut = new GridFutureAdapter<>();
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/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 542d0ad..76fd69b 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
@@ -2623,7 +2623,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
 
         ttlAndExpireTimeExtras(ttl, expireTime);
 
-        if (expireTime != 0 && expireTime != oldExpireTime && cctx.config().isEagerTtl())
+        if (expireTime != 0 && (expireTime != oldExpireTime || isStartVersion()) && cctx.config().isEagerTtl())
             cctx.ttl().addTrackedEntry(this);
 
         this.ver = ver;
@@ -3508,26 +3508,32 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
 
         try {
             synchronized (this) {
-                CacheObject expiredVal = val;
+                CacheObject expiredVal = saveValueForIndexUnlocked();
 
                 boolean hasOldBytes = valPtr != 0;
 
                 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(expiredVal);
+
+                    releaseSwap();
 
                     if (cctx.events().isRecordable(EVT_CACHE_OBJECT_EXPIRED)) {
                         cctx.events().addEvent(partition(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java
index b0f5b2e..83a108f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java
@@ -1014,7 +1014,7 @@ public final class GridCacheMvcc {
             for (Iterator<GridCacheMvccCandidate> it = rmts.iterator(); it.hasNext(); ) {
                 GridCacheMvccCandidate cand = it.next();
 
-                if (!cand.tx() && nodeId.equals(cand.nodeId())) {
+                if (!cand.tx() && (nodeId.equals(cand.nodeId()) || nodeId.equals(cand.otherNodeId()))) {
                     cand.setUsed(); // Mark as used to be consistent.
                     cand.setRemoved();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccCandidate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccCandidate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccCandidate.java
index c5f26cb..894e465 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccCandidate.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccCandidate.java
@@ -17,10 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.processors.affinity.*;
 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.jetbrains.annotations.*;
 
@@ -94,6 +96,14 @@ public class GridCacheMvccCandidate implements Externalizable,
     /** Other lock version (near version vs dht version). */
     private transient GridCacheVersion otherVer;
 
+    /** Mapped DHT node IDs. */
+    @GridToStringInclude
+    private transient volatile Collection<ClusterNode> mappedDhtNodes;
+
+    /** Mapped near node IDs. */
+    @GridToStringInclude
+    private transient volatile Collection<ClusterNode> mappedNearNodes;
+
     /** Owned lock version by the moment this candidate was added. */
     @GridToStringInclude
     private transient volatile GridCacheVersion ownerVer;
@@ -229,13 +239,6 @@ public class GridCacheMvccCandidate implements Externalizable,
     }
 
     /**
-     * @return {@code True} if has reentry.
-     */
-    public boolean hasReentry() {
-        return reentry != null;
-    }
-
-    /**
      * @return Removed reentry candidate or {@code null}.
      */
     @Nullable public GridCacheMvccCandidate unenter() {
@@ -282,6 +285,39 @@ public class GridCacheMvccCandidate implements Externalizable,
     }
 
     /**
+     * @return Mapped node IDs.
+     */
+    public Collection<ClusterNode> mappedDhtNodes() {
+        return mappedDhtNodes;
+    }
+
+    /**
+     * @return Mapped node IDs.
+     */
+    public Collection<ClusterNode> mappedNearNodes() {
+        return mappedNearNodes;
+    }
+
+    /**
+     * @param mappedDhtNodes Mapped DHT node IDs.
+     */
+    public void mappedNodeIds(Collection<ClusterNode> mappedDhtNodes, Collection<ClusterNode> mappedNearNodes) {
+        this.mappedDhtNodes = mappedDhtNodes;
+        this.mappedNearNodes = mappedNearNodes;
+    }
+
+    /**
+     * @param node Node to remove.
+     */
+    public void removeMappedNode(ClusterNode node) {
+        if (mappedDhtNodes.contains(node))
+            mappedDhtNodes = new ArrayList<>(F.view(mappedDhtNodes, F.notEqualTo(node)));
+
+        if (mappedNearNodes != null && mappedNearNodes.contains(node))
+            mappedNearNodes = new ArrayList<>(F.view(mappedNearNodes, F.notEqualTo(node)));
+    }
+
+    /**
      * @return Near version.
      */
     public GridCacheVersion otherVersion() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index 081ea78..a569e56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -174,17 +174,6 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
             if (log.isDebugEnabled())
                 log.debug("Processing node left [nodeId=" + discoEvt.eventNode().id() + "]");
 
-            for (GridDistributedCacheEntry entry : locked()) {
-                try {
-                    entry.removeExplicitNodeLocks(discoEvt.eventNode().id());
-                }
-                catch (GridCacheEntryRemovedException ignore) {
-                    if (log.isDebugEnabled())
-                        log.debug("Attempted to remove node locks from removed entry in mvcc manager " +
-                            "disco callback (will ignore): " + entry);
-                }
-            }
-
             for (Collection<GridCacheFuture<?>> futsCol : futs.values()) {
                 for (GridCacheFuture<?> fut : futsCol) {
                     if (!fut.trackable()) {
@@ -239,6 +228,39 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
     }
 
     /**
+     * @return Collection of pending explicit locks.
+     */
+    public Collection<GridCacheExplicitLockSpan> activeExplicitLocks() {
+        return pendingExplicit.values();
+    }
+
+    /**
+     * @return Collection of active futures.
+     */
+    public Collection<GridCacheFuture<?>> activeFutures() {
+        return F.flatCollections(futs.values());
+    }
+
+    /**
+     * @param leftNodeId Left node ID.
+     * @param topVer Topology version.
+     */
+    public void removeExplicitNodeLocks(UUID leftNodeId, AffinityTopologyVersion topVer) {
+        for (GridDistributedCacheEntry entry : locked()) {
+            try {
+                entry.removeExplicitNodeLocks(leftNodeId);
+
+                entry.context().evicts().touch(entry, topVer);
+            }
+            catch (GridCacheEntryRemovedException ignore) {
+                if (log.isDebugEnabled())
+                    log.debug("Attempted to remove node locks from removed entry in mvcc manager " +
+                        "disco callback (will ignore): " + entry);
+            }
+        }
+    }
+
+    /**
      * @param from From version.
      * @param to To version.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/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..9fb9f46 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
@@ -316,8 +316,11 @@ public class GridDistributedCacheEntry extends GridCacheMapEntry {
 
                 refreshRemotes();
 
-                if (emptyAfter)
+                if (emptyAfter) {
                     mvccExtras(null);
+
+                    onUnlock();
+                }
             }
         }
 
@@ -326,6 +329,13 @@ public class GridDistributedCacheEntry extends GridCacheMapEntry {
     }
 
     /**
+     *
+     */
+    public void onUnlock() {
+        // No-op.
+    }
+
+    /**
      * Unlocks local lock.
      *
      * @return Removed candidate, or <tt>null</tt> if thread still holds the lock.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/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 e6d5173..7762763 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
@@ -297,7 +297,9 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
     /**
      * Calls {@link GridDhtLocalPartition#onUnlock()} for this entry's partition.
      */
-    public void onUnlock() {
+    @Override public void onUnlock() {
+        super.onUnlock();
+
         locPart.onUnlock();
     }
 
@@ -644,13 +646,34 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
      * @return Candidate, if one existed for the version, or {@code null} if candidate was not found.
      * @throws GridCacheEntryRemovedException If removed.
      */
-    @Nullable public synchronized GridCacheMvccCandidate mappings(GridCacheVersion ver)
-        throws GridCacheEntryRemovedException {
+    @Nullable public synchronized GridCacheMvccCandidate mappings(
+        GridCacheVersion ver,
+        Collection<ClusterNode> dhtNodeIds,
+        Collection<ClusterNode> nearNodeIds
+    ) throws GridCacheEntryRemovedException {
         checkObsolete();
 
         GridCacheMvcc mvcc = mvccExtras();
 
-        return mvcc == null ? null : mvcc.candidate(ver);
+        GridCacheMvccCandidate cand = mvcc == null ? null : mvcc.candidate(ver);
+
+        if (cand != null)
+            cand.mappedNodeIds(dhtNodeIds, nearNodeIds);
+
+        return cand;
+    }
+
+    /**
+     * @param ver Version.
+     * @param mappedNode Mapped node to remove.
+     */
+    public synchronized void removeMapping(GridCacheVersion ver, ClusterNode mappedNode) {
+        GridCacheMvcc mvcc = mvccExtras();
+
+        GridCacheMvccCandidate cand = mvcc == null ? null : mvcc.candidate(ver);
+
+        if (cand != null)
+            cand.removeMappedNode(mappedNode);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 7e93946..9898cf0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -188,7 +188,7 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
             lockVer = cctx.mvcc().mappedVersion(nearLockVer);
 
             if (lockVer == null)
-                lockVer = cctx.versions().onReceivedAndNext(nearNodeId, nearLockVer);
+                lockVer = nearLockVer;
         }
 
         futId = IgniteUuid.randomUuid();
@@ -749,9 +749,16 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
                 try {
                     while (true) {
                         try {
-                            hasRmtNodes = cctx.dhtMap(nearNodeId, topVer, entry, log, dhtMap, null);
+                            hasRmtNodes = cctx.dhtMap(
+                                nearNodeId,
+                                topVer,
+                                entry,
+                                tx == null ? lockVer : null,
+                                log,
+                                dhtMap,
+                                null);
 
-                            GridCacheMvccCandidate cand = entry.mappings(lockVer);
+                            GridCacheMvccCandidate cand = entry.candidate(lockVer);
 
                             // Possible in case of lock cancellation.
                             if (cand == null) {
@@ -1097,6 +1104,8 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
 
                             if (tx != null)
                                 tx.removeDhtMapping(node.id(), entry);
+                            else
+                                entry.removeMapping(lockVer, node);
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 737e3ed..78bf4a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -795,6 +795,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                     req.implicitTx(),
                                     req.implicitSingleTx(),
                                     ctx.system(),
+                                    false,
                                     ctx.ioPolicy(),
                                     PESSIMISTIC,
                                     req.isolation(),
@@ -1165,13 +1166,9 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                 while (true) {
                     GridDistributedCacheEntry entry = peekExx(key);
 
-                    boolean created = false;
-
-                    if (entry == null) {
-                        entry = entryExx(key);
-
-                        created = true;
-                    }
+                    if (entry == null)
+                        // Nothing to unlock.
+                        break;
 
                     try {
                         entry.doneRemote(
@@ -1195,9 +1192,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                     "(added to cancelled locks set): " + req);
                         }
 
-                        if (created && entry.markObsolete(req.version()))
-                            removeEntry(entry);
-
                         ctx.evicts().touch(entry, ctx.affinity().affinityTopologyVersion());
 
                         break;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 728145a..8e8a0a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -243,13 +243,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
     }
 
     /**
-     * Completes this future.
-     */
-    void complete() {
-        onComplete();
-    }
-
-    /**
      * Initializes future.
      */
     public void finish() {
@@ -279,10 +272,13 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
         if (tx.onePhaseCommit())
             return false;
 
-        boolean res = false;
-
         boolean sync = commit ? tx.syncCommit() : tx.syncRollback();
 
+        if (tx.explicitLock())
+            sync = true;
+
+        boolean res = false;
+
         // Create mini futures.
         for (GridDistributedTxMapping dhtMapping : dhtMap.values()) {
             ClusterNode n = dhtMapping.node();
@@ -313,8 +309,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                 tx.system(),
                 tx.ioPolicy(),
                 tx.isSystemInvalidate(),
-                tx.syncCommit(),
-                tx.syncRollback(),
+                sync,
+                sync,
                 tx.completedBase(),
                 tx.committedVersions(),
                 tx.rolledbackVersions(),
@@ -365,8 +361,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                     tx.system(),
                     tx.ioPolicy(),
                     tx.isSystemInvalidate(),
-                    tx.syncCommit(),
-                    tx.syncRollback(),
+                    sync,
+                    sync,
                     tx.completedBase(),
                     tx.committedVersions(),
                     tx.rolledbackVersions(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
index 00e8e3e..f3266df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -107,6 +107,7 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
         boolean implicit,
         boolean implicitSingle,
         boolean sys,
+        boolean explicitLock,
         GridIoPolicy plc,
         TransactionConcurrency concurrency,
         TransactionIsolation isolation,
@@ -126,6 +127,7 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
             implicit,
             implicitSingle,
             sys,
+            explicitLock,
             plc,
             concurrency,
             isolation,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 5e37d96..e0f2008 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -65,6 +65,9 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
     private long dhtThreadId;
 
     /** */
+    protected boolean explicitLock;
+
+    /** */
     private boolean needsCompletedVers;
 
     /** Versions of pending locks for entries of this tx. */
@@ -96,6 +99,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
         boolean implicit,
         boolean implicitSingle,
         boolean sys,
+        boolean explicitLock,
         GridIoPolicy plc,
         TransactionConcurrency concurrency,
         TransactionIsolation isolation,
@@ -113,6 +117,8 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
 
         assert cctx != null;
 
+        this.explicitLock = explicitLock;
+
         threadId = Thread.currentThread().getId();
         dhtThreadId = threadId;
     }
@@ -179,6 +185,20 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
     }
 
     /**
+     * @return Explicit lock flag.
+     */
+    public boolean explicitLock() {
+        return explicitLock;
+    }
+
+    /**
+     * @param explicitLock Explicit lock flag.
+     */
+    public void explicitLock(boolean explicitLock) {
+        this.explicitLock = explicitLock;
+    }
+
+    /**
      * @return DHT thread ID.
      */
     long dhtThreadId() {
@@ -227,8 +247,12 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
                             if (nearEntryMap == null)
                                 nearEntryMap = new GridLeanMap<>();
 
-                            cacheCtx.dhtMap(nearNodeId(), topologyVersion(),
-                                (GridDhtCacheEntry)e.cached(), log, dhtEntryMap, nearEntryMap);
+                            cacheCtx.dhtMap(
+                                (GridDhtCacheEntry)e.cached(),
+                                e.explicitVersion(),
+                                log,
+                                dhtEntryMap,
+                                nearEntryMap);
                         }
 
                         break;
@@ -828,6 +852,6 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
     /** {@inheritDoc} */
     @Override public String toString() {
         return GridToStringBuilder.toString(GridDhtTxLocalAdapter.class, this, "nearNodes", nearMap.keySet(),
-            "dhtNodes", dhtMap.keySet(), "super", super.toString());
+            "dhtNodes", dhtMap.keySet(), "explicitLock", explicitLock, "super", super.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index e0fc719..87e5a29 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -856,13 +856,15 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
                     if (!F.isEmpty(nearWrites)) {
                         for (IgniteTxEntry entry : nearWrites) {
                             try {
-                                GridCacheMvccCandidate added = entry.cached().candidate(version());
+                                if (entry.explicitVersion() == null) {
+                                    GridCacheMvccCandidate added = entry.cached().candidate(version());
 
-                                assert added != null;
-                                assert added.dhtLocal();
+                                    assert added != null : "Missing candidate for cache entry:" + entry;
+                                    assert added.dhtLocal();
 
-                                if (added.ownerVersion() != null)
-                                    req.owned(entry.txKey(), added.ownerVersion());
+                                    if (added.ownerVersion() != null)
+                                        req.owned(entry.txKey(), added.ownerVersion());
+                                }
 
                                 break;
                             }
@@ -912,15 +914,17 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
 
                         for (IgniteTxEntry entry : nearMapping.writes()) {
                             try {
-                                GridCacheMvccCandidate added = entry.cached().candidate(version());
+                                if (entry.explicitVersion() == null) {
+                                    GridCacheMvccCandidate added = entry.cached().candidate(version());
 
-                                assert added != null || entry.groupLockEntry() : "Null candidate for non-group-lock entry " +
-                                    "[added=" + added + ", entry=" + entry + ']';
-                                assert added == null || added.dhtLocal() : "Got non-dht-local candidate for prepare future" +
-                                    "[added=" + added + ", entry=" + entry + ']';
+                                    assert added != null || entry.groupLockEntry() : "Null candidate for non-group-lock entry " +
+                                        "[added=" + added + ", entry=" + entry + ']';
+                                    assert added == null || added.dhtLocal() : "Got non-dht-local candidate for prepare future" +
+                                        "[added=" + added + ", entry=" + entry + ']';
 
-                                if (added != null && added.ownerVersion() != null)
-                                    req.owned(entry.txKey(), added.ownerVersion());
+                                    if (added != null && added.ownerVersion() != null)
+                                        req.owned(entry.txKey(), added.ownerVersion());
+                                }
 
                                 break;
                             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/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..e941d30 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
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht.colocated;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -501,9 +502,20 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
 
                 assert !n.isLocal();
 
-                if (!F.isEmpty(req.keys()))
-                    // We don't wait for reply to this message.
-                    ctx.io().send(n, req, ctx.ioPolicy());
+                if (!F.isEmpty(req.keys())) {
+                    try {
+                        // We don't wait for reply to this message.
+                        ctx.io().send(n, req, ctx.ioPolicy());
+                    }
+                    catch (ClusterTopologyCheckedException e) {
+                        if (log.isDebugEnabled())
+                            log.debug("Failed to send unlock request (node has left the grid) [keys=" + req.keys() +
+                                ", n=" + n + ", e=" + e + ']');
+                    }
+                    catch (IgniteCheckedException e) {
+                        U.error(log, "Failed to send unlock request [keys=" + req.keys() + ", n=" + n + ']', e);
+                    }
+                }
             }
         }
         catch (IgniteCheckedException ex) {
@@ -584,8 +596,18 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                 if (!F.isEmpty(req.keys())) {
                     req.completedVersions(committed, rolledback);
 
-                    // We don't wait for reply to this message.
-                    ctx.io().send(n, req, ctx.ioPolicy());
+                    try {
+                        // We don't wait for reply to this message.
+                        ctx.io().send(n, req, ctx.ioPolicy());
+                    }
+                    catch (ClusterTopologyCheckedException e) {
+                        if (log.isDebugEnabled())
+                            log.debug("Failed to send unlock request (node has left the grid) [keys=" + req.keys() +
+                                ", n=" + n + ", e=" + e + ']');
+                    }
+                    catch (IgniteCheckedException e) {
+                        U.error(log, "Failed to send unlock request [keys=" + req.keys() + ", n=" + n + ']', e);
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 3087dff..7b05065 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -141,6 +141,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
         this.accessTtl = accessTtl;
         this.filter = filter;
 
+        ignoreInterrupts(true);
+
         threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
 
         lockVer = tx != null ? tx.xidVersion() : cctx.versions().next();
@@ -517,8 +519,13 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
      */
     void map() {
         // Obtain the topology version to use.
-        AffinityTopologyVersion topVer = tx != null ? tx.topologyVersionSnapshot() :
-            cctx.mvcc().lastExplicitLockTopologyVersion(threadId);
+        AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId);
+
+        if (topVer != null && tx != null)
+            tx.topologyVersion(topVer);
+
+        if (topVer == null && tx != null)
+            topVer = tx.topologyVersionSnapshot();
 
         if (topVer != null) {
             // Continue mapping on the same topology version as it was before.
@@ -651,15 +658,30 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
                 Collection<KeyCacheObject> distributedKeys = new ArrayList<>(mappedKeys.size());
 
                 for (KeyCacheObject key : mappedKeys) {
-                    boolean explicit;
-
                     IgniteTxKey txKey = cctx.txKey(key);
 
-                    while (true) {
-                        GridDistributedCacheEntry entry = null;
+                    GridDistributedCacheEntry entry = null;
+
+                    if (tx != null) {
+                        IgniteTxEntry txEntry = tx.entry(txKey);
+
+                        if (txEntry != null) {
+                            entry = (GridDistributedCacheEntry)txEntry.cached();
+
+                            if (entry != null && !(loc ^ entry.detached())) {
+                                entry = cctx.colocated().entryExx(key, topVer, true);
+
+                                txEntry.cached(entry);
+                            }
+                        }
+                    }
+
+                    boolean explicit;
 
+                    while (true) {
                         try {
-                            entry = cctx.colocated().entryExx(key, topVer, true);
+                            if (entry == null)
+                                entry = cctx.colocated().entryExx(key, topVer, true);
 
                             if (!cctx.isAll(entry, filter)) {
                                 if (log.isDebugEnabled())
@@ -941,6 +963,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
         // Assign keys to primary nodes.
         Collection<KeyCacheObject> distributedKeys = new ArrayList<>(keys.size());
 
+        boolean explicit = false;
+
         for (KeyCacheObject key : keys) {
             if (!cctx.affinity().primary(cctx.localNode(), key, topVer)) {
                 // Remove explicit locks added so far.
@@ -950,7 +974,7 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
                 return false;
             }
 
-            addLocalKey(key, topVer, distributedKeys);
+            explicit |= addLocalKey(key, topVer, distributedKeys);
 
             if (isDone())
                 return true;
@@ -958,8 +982,12 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
 
         trackable = false;
 
-        if (tx != null)
+        if (tx != null) {
+            if (explicit)
+                tx.markExplicit(cctx.localNodeId());
+
             tx.colocatedLocallyMapped(true);
+        }
 
         if (!distributedKeys.isEmpty()) {
             if (tx != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index ddf0df1..ccc2d8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.managers.discovery.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 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.processors.timeout.*;
 import org.apache.ignite.internal.util.*;
@@ -564,7 +565,17 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
                 if (log.isDebugEnabled())
                     log.debug("Before waiting for partition release future: " + this);
 
-                partReleaseFut.get();
+                while (true) {
+                    try {
+                        partReleaseFut.get(2 * cctx.gridConfig().getNetworkTimeout(), TimeUnit.MILLISECONDS);
+
+                        break;
+                    }
+                    catch (IgniteFutureTimeoutCheckedException ignored) {
+                        // Print pending transactions and locks that might have led to hang.
+                        dumpPendingObjects();
+                    }
+                }
 
                 if (log.isDebugEnabled())
                     log.debug("After waiting for partition release future: " + this);
@@ -572,6 +583,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
                 if (!F.isEmpty(reqs))
                     blockGateways();
 
+                if (exchId.isLeft())
+                    cctx.mvcc().removeExplicitNodeLocks(exchId.nodeId(), exchId.topologyVersion());
+
                 for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
                     if (cacheCtx.isLocal())
                         continue;
@@ -658,6 +672,29 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
     }
 
     /**
+     *
+     */
+    private void dumpPendingObjects() {
+        U.warn(log, "Failed to wait for partition release future. Dumping pending objects that might be the cause: " +
+            cctx.localNodeId());
+
+        U.warn(log, "Pending transactions:");
+
+        for (IgniteInternalTx tx : cctx.tm().activeTransactions())
+            U.warn(log, ">>> " + tx);
+
+        U.warn(log, "Pending explicit locks:");
+
+        for (GridCacheExplicitLockSpan lockSpan : cctx.mvcc().activeExplicitLocks())
+            U.warn(log, ">>> " + lockSpan);
+
+        U.warn(log, "Pending cache futures:");
+
+        for (GridCacheFuture<?> fut : cctx.mvcc().activeFutures())
+            U.warn(log, ">>> " + fut);
+    }
+
+    /**
      * @param cacheId Cache ID to check.
      * @return {@code True} if cache is stopping by this exchange.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/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..74342fd 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
@@ -499,7 +499,15 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
                 return null;
 
             // Local lock for near cache is a local lock.
-            cand = mvcc.addNearLocal(this, locId, dhtNodeId, threadId, ver, timeout, tx, implicitSingle);
+            cand = mvcc.addNearLocal(
+                this,
+                locId,
+                dhtNodeId,
+                threadId,
+                ver,
+                timeout,
+                tx,
+                implicitSingle);
 
             owner = mvcc.anyOwner();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index d6d1a1b..a25d546 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -152,6 +152,8 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
         this.accessTtl = accessTtl;
         this.filter = filter;
 
+        ignoreInterrupts(true);
+
         threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
 
         lockVer = tx != null ? tx.xidVersion() : cctx.versions().next();
@@ -649,8 +651,13 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
      */
     void map() {
         // Obtain the topology version to use.
-        AffinityTopologyVersion topVer = tx != null ? tx.topologyVersionSnapshot() :
-            cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
+        AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
+
+        if (topVer != null && tx != null)
+            tx.topologyVersion(topVer);
+
+        if (topVer == null && tx != null)
+            topVer = tx.topologyVersionSnapshot();
 
         if (topVer != null) {
             // Continue mapping on the same topology version as it was before.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 5d1a306..3b2418e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -62,7 +62,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
     private IgniteUuid futId;
 
     /** Transaction. */
-    @GridToStringExclude
+    @GridToStringInclude
     private GridNearTxLocal tx;
 
     /** Commit flag. */
@@ -85,12 +85,12 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
     public GridNearTxFinishFuture(GridCacheSharedContext<K, V> cctx, GridNearTxLocal tx, boolean commit) {
         super(cctx.kernalContext(), F.<IgniteInternalTx>identityReducer(tx));
 
-        assert cctx != null;
-
         this.cctx = cctx;
         this.tx = tx;
         this.commit = commit;
 
+        ignoreInterrupts(true);
+
         mappings = tx.mappings();
 
         futId = IgniteUuid.randomUuid();
@@ -264,7 +264,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
      * @return Synchronous flag.
      */
     private boolean isSync() {
-        return commit ? tx.syncCommit() : tx.syncRollback();
+        return tx.explicitLock() || (commit ? tx.syncCommit() : tx.syncRollback());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index fa916b0..1b2d204 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -30,6 +30,7 @@ import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.transactions.*;
 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.*;
 import org.apache.ignite.lang.*;
@@ -59,14 +60,17 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
         new ConcurrentHashMap8<>();
 
     /** Future. */
+    @GridToStringExclude
     private final AtomicReference<IgniteInternalFuture<IgniteInternalTx>> prepFut =
         new AtomicReference<>();
 
     /** */
+    @GridToStringExclude
     private final AtomicReference<GridNearTxFinishFuture> commitFut =
         new AtomicReference<>();
 
     /** */
+    @GridToStringExclude
     private final AtomicReference<GridNearTxFinishFuture> rollbackFut =
         new AtomicReference<>();
 
@@ -126,6 +130,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
             implicit,
             implicitSingle,
             sys,
+            false,
             plc,
             concurrency,
             isolation,
@@ -527,6 +532,8 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
      * @return {@code True} if mapping was found.
      */
     public boolean markExplicit(UUID nodeId) {
+        explicitLock = true;
+
         GridDistributedTxMapping m = mappings.get(nodeId);
 
         if (m != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index 2da78fb..39a33b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -68,7 +68,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
     private IgniteUuid futId;
 
     /** Transaction. */
-    @GridToStringExclude
+    @GridToStringInclude
     private GridNearTxLocal tx;
 
     /** Error. */
@@ -198,6 +198,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
 
                 tx.removeKeysMapping(nodeId, mappings);
             }
+
             if (e instanceof IgniteTxRollbackCheckedException) {
                 if (marked) {
                     try {
@@ -308,62 +309,59 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
      */
     public void prepare() {
         if (tx.optimistic()) {
-            GridDhtTopologyFuture topFut = topologyReadLock();
+            // Obtain the topology version to use.
+            AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
 
-            try {
-                if (topFut == null) {
-                    assert isDone();
+            if (topVer != null) {
+                tx.topologyVersion(topVer);
 
-                    return;
-                }
+                prepare0();
 
-                if (topFut.isDone()) {
-                    try {
-                        if (!tx.state(PREPARING)) {
-                            if (tx.setRollbackOnly()) {
-                                if (tx.timedOut())
-                                    onError(null, null, new IgniteTxTimeoutCheckedException("Transaction timed out and " +
-                                        "was rolled back: " + this));
-                                else
-                                    onError(null, null, new IgniteCheckedException("Invalid transaction state for prepare " +
-                                        "[state=" + tx.state() + ", tx=" + this + ']'));
-                            }
-                            else
-                                onError(null, null, new IgniteTxRollbackCheckedException("Invalid transaction state for " +
-                                    "prepare [state=" + tx.state() + ", tx=" + this + ']'));
+                return;
+            }
 
-                            return;
-                        }
+            prepareOnTopology();
 
-                        tx.topologyVersion(topFut.topologyVersion());
+        }
+        else
+            preparePessimistic();
+    }
 
-                        // Make sure to add future before calling prepare.
-                        cctx.mvcc().addFuture(this);
+    /**
+     *
+     */
+    private void prepareOnTopology() {
+        GridDhtTopologyFuture topFut = topologyReadLock();
 
-                        prepare0();
-                    }
-                    catch (TransactionTimeoutException | TransactionOptimisticException e) {
-                        onError(cctx.localNodeId(), null, e);
-                    }
-                }
-                else {
-                    topFut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
-                        @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
-                            cctx.kernalContext().closure().runLocalSafe(new GridPlainRunnable() {
-                                @Override public void run() {
-                                    prepare();
-                                }
-                            });
-                        }
-                    });
-                }
+        try {
+            if (topFut == null) {
+                assert isDone();
+
+                return;
+            }
+
+            if (topFut.isDone()) {
+                tx.topologyVersion(topFut.topologyVersion());
+
+                prepare0();
             }
-            finally {
-                topologyReadUnlock();
+            else {
+                topFut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
+                    @Override
+                    public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
+                        cctx.kernalContext().closure().runLocalSafe(new GridPlainRunnable() {
+                            @Override
+                            public void run() {
+                                prepareOnTopology();
+                            }
+                        });
+                    }
+                });
             }
         }
-        else
-            preparePessimistic();
+        finally {
+            topologyReadUnlock();
+        }
     }
 
     /**
@@ -431,12 +429,34 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
         assert tx.optimistic();
 
         try {
+            if (!tx.state(PREPARING)) {
+                if (tx.setRollbackOnly()) {
+                    if (tx.timedOut())
+                        onError(null, null, new IgniteTxTimeoutCheckedException("Transaction timed out and " +
+                            "was rolled back: " + this));
+                    else
+                        onError(null, null, new IgniteCheckedException("Invalid transaction state for prepare " +
+                            "[state=" + tx.state() + ", tx=" + this + ']'));
+                }
+                else
+                    onError(null, null, new IgniteTxRollbackCheckedException("Invalid transaction state for " +
+                        "prepare [state=" + tx.state() + ", tx=" + this + ']'));
+
+                return;
+            }
+
+            // Make sure to add future before calling prepare.
+            cctx.mvcc().addFuture(this);
+
             prepare(
                 tx.optimistic() && tx.serializable() ? tx.readEntries() : Collections.<IgniteTxEntry>emptyList(),
                 tx.writeEntries());
 
             markInitialized();
         }
+        catch (TransactionTimeoutException | TransactionOptimisticException e) {
+            onError(cctx.localNodeId(), null, e);
+        }
         catch (IgniteCheckedException e) {
             onDone(e);
         }
@@ -592,6 +612,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
                 tx.onePhaseCommit(),
                 tx.needReturnValue() && tx.implicit(),
                 tx.implicitSingle(),
+                m.explicitLock(),
                 tx.subjectId(),
                 tx.taskNameHash());
 
@@ -682,6 +703,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
             tx.onePhaseCommit(),
             tx.needReturnValue() && tx.implicit(),
             tx.implicitSingle(),
+            m.explicitLock(),
             tx.subjectId(),
             tx.taskNameHash());
 
@@ -790,6 +812,12 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
 
         cur.add(entry);
 
+        if (entry.explicitVersion() != null) {
+            tx.markExplicit(primary.id());
+
+            cur.markExplicitLock();
+        }
+
         entry.nodeId(primary.id());
 
         if (cacheCtx.isNear()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index 846022c..f0587ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -66,6 +66,9 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
     /** Implicit single flag. */
     private boolean implicitSingle;
 
+    /** Explicit lock flag. Set to true if at leat one entry was explicitly locked. */
+    private boolean explicitLock;
+
     /** Subject ID. */
     private UUID subjId;
 
@@ -109,6 +112,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         boolean onePhaseCommit,
         boolean retVal,
         boolean implicitSingle,
+        boolean explicitLock,
         @Nullable UUID subjId,
         int taskNameHash
     ) {
@@ -123,6 +127,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         this.lastBackups = lastBackups;
         this.retVal = retVal;
         this.implicitSingle = implicitSingle;
+        this.explicitLock = explicitLock;
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
     }
@@ -198,6 +203,13 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
     }
 
     /**
+     * @return Explicit lock flag.
+     */
+    public boolean explicitLock() {
+        return explicitLock;
+    }
+
+    /**
      * @return Topology version.
      */
     @Override public AffinityTopologyVersion topologyVersion() {
@@ -259,60 +271,66 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
         switch (writer.state()) {
             case 25:
-                if (!writer.writeIgniteUuid("futId", futId))
+                if (!writer.writeBoolean("explicitLock", explicitLock))
                     return false;
 
                 writer.incrementState();
 
             case 26:
-                if (!writer.writeBoolean("implicitSingle", implicitSingle))
+                if (!writer.writeIgniteUuid("futId", futId))
                     return false;
 
                 writer.incrementState();
 
             case 27:
-                if (!writer.writeBoolean("last", last))
+                if (!writer.writeBoolean("implicitSingle", implicitSingle))
                     return false;
 
                 writer.incrementState();
 
             case 28:
-                if (!writer.writeCollection("lastBackups", lastBackups, MessageCollectionItemType.UUID))
+                if (!writer.writeBoolean("last", last))
                     return false;
 
                 writer.incrementState();
 
             case 29:
-                if (!writer.writeIgniteUuid("miniId", miniId))
+                if (!writer.writeCollection("lastBackups", lastBackups, MessageCollectionItemType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 30:
-                if (!writer.writeBoolean("near", near))
+                if (!writer.writeIgniteUuid("miniId", miniId))
                     return false;
 
                 writer.incrementState();
 
             case 31:
-                if (!writer.writeBoolean("retVal", retVal))
+                if (!writer.writeBoolean("near", near))
                     return false;
 
                 writer.incrementState();
 
             case 32:
-                if (!writer.writeUuid("subjId", subjId))
+                if (!writer.writeBoolean("retVal", retVal))
                     return false;
 
                 writer.incrementState();
 
             case 33:
-                if (!writer.writeInt("taskNameHash", taskNameHash))
+                if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
             case 34:
+                if (!writer.writeInt("taskNameHash", taskNameHash))
+                    return false;
+
+                writer.incrementState();
+
+            case 35:
                 if (!writer.writeMessage("topVer", topVer))
                     return false;
 
@@ -335,7 +353,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
         switch (reader.state()) {
             case 25:
-                futId = reader.readIgniteUuid("futId");
+                explicitLock = reader.readBoolean("explicitLock");
 
                 if (!reader.isLastRead())
                     return false;
@@ -343,7 +361,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 26:
-                implicitSingle = reader.readBoolean("implicitSingle");
+                futId = reader.readIgniteUuid("futId");
 
                 if (!reader.isLastRead())
                     return false;
@@ -351,7 +369,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 27:
-                last = reader.readBoolean("last");
+                implicitSingle = reader.readBoolean("implicitSingle");
 
                 if (!reader.isLastRead())
                     return false;
@@ -359,7 +377,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 28:
-                lastBackups = reader.readCollection("lastBackups", MessageCollectionItemType.UUID);
+                last = reader.readBoolean("last");
 
                 if (!reader.isLastRead())
                     return false;
@@ -367,7 +385,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 29:
-                miniId = reader.readIgniteUuid("miniId");
+                lastBackups = reader.readCollection("lastBackups", MessageCollectionItemType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -375,7 +393,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 30:
-                near = reader.readBoolean("near");
+                miniId = reader.readIgniteUuid("miniId");
 
                 if (!reader.isLastRead())
                     return false;
@@ -383,7 +401,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 31:
-                retVal = reader.readBoolean("retVal");
+                near = reader.readBoolean("near");
 
                 if (!reader.isLastRead())
                     return false;
@@ -391,7 +409,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 32:
-                subjId = reader.readUuid("subjId");
+                retVal = reader.readBoolean("retVal");
 
                 if (!reader.isLastRead())
                     return false;
@@ -399,7 +417,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 33:
-                taskNameHash = reader.readInt("taskNameHash");
+                subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
                     return false;
@@ -407,6 +425,14 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
                 reader.incrementState();
 
             case 34:
+                taskNameHash = reader.readInt("taskNameHash");
+
+                if (!reader.isLastRead())
+                    return false;
+
+                reader.incrementState();
+
+            case 35:
                 topVer = reader.readMessage("topVer");
 
                 if (!reader.isLastRead())
@@ -426,7 +452,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 35;
+        return 36;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 1b66b4a..735e373 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1164,7 +1164,8 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
 
     /** {@inheritDoc} */
     @Override public void onTimeout() {
-        state(MARKED_ROLLBACK, true);
+        if (local() && !dht())
+            state(MARKED_ROLLBACK, true);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index da30a94..8e47105 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -268,6 +268,7 @@ public class IgniteTxHandler {
                 req.implicitSingle(),
                 req.implicitSingle(),
                 req.system(),
+                req.explicitLock(),
                 req.policy(),
                 req.concurrency(),
                 req.isolation(),
@@ -292,6 +293,9 @@ public class IgniteTxHandler {
         }
 
         if (tx != null) {
+            if (req.explicitLock())
+                tx.explicitLock(req.explicitLock());
+
             tx.transactionNodes(req.transactionNodes());
 
             if (req.onePhaseCommit()) {
@@ -538,6 +542,7 @@ public class IgniteTxHandler {
                             true,
                             false, /* we don't know, so assume false. */
                             req.system(),
+                            req.explicitLock(),
                             req.policy(),
                             PESSIMISTIC,
                             READ_COMMITTED,
@@ -556,6 +561,10 @@ public class IgniteTxHandler {
 
                     tx.topologyVersion(req.topologyVersion());
                 }
+                else {
+                    if (req.explicitLock())
+                        tx.explicitLock(req.explicitLock());
+                }
 
                 tx.storeEnabled(req.storeEnabled());
 
@@ -580,20 +589,44 @@ public class IgniteTxHandler {
                 return commitFut;
             }
             else {
-                assert tx != null : "Transaction is null for near rollback request [nodeId=" +
+                assert tx != null || req.explicitLock() : "Transaction is null for near rollback request [nodeId=" +
                     nodeId + ", req=" + req + "]";
 
-                tx.syncRollback(req.syncRollback());
+                if (tx != null) {
+                    tx.syncRollback(req.syncRollback());
 
-                tx.nearFinishFutureId(req.futureId());
-                tx.nearFinishMiniId(req.miniId());
+                    tx.nearFinishFutureId(req.futureId());
+                    tx.nearFinishMiniId(req.miniId());
 
-                IgniteInternalFuture<IgniteInternalTx> rollbackFut = tx.rollbackAsync();
+                    IgniteInternalFuture<IgniteInternalTx> rollbackFut = tx.rollbackAsync();
 
-                // Only for error logging.
-                rollbackFut.listen(CU.errorLogger(log));
+                    // Only for error logging.
+                    rollbackFut.listen(CU.errorLogger(log));
 
-                return rollbackFut;
+                    return rollbackFut;
+                }
+                else {
+                    // Always send finish response.
+                    GridCacheMessage res = new GridNearTxFinishResponse(req.version(), req.threadId(),
+                        req.futureId(), req.miniId(), null);
+
+                    try {
+                        ctx.io().send(nodeId, res, req.policy());
+                    }
+                    catch (Throwable e) {
+                        // Double-check.
+                        if (ctx.discovery().node(nodeId) == null) {
+                            if (log.isDebugEnabled())
+                                log.debug("Node left while sending finish response [nodeId=" + nodeId + ", res=" + res +
+                                    ']');
+                        }
+                        else
+                            U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", " +
+                                "res=" + res + ']', e);
+                    }
+
+                    return null;
+                }
             }
         }
         catch (Throwable e) {
@@ -757,15 +790,36 @@ public class IgniteTxHandler {
         if (nearTx != null)
             finish(nodeId, nearTx, req);
 
-        if (dhtTx != null && !dhtTx.done()) {
-            dhtTx.finishFuture().listen(new CI1<IgniteInternalFuture<IgniteInternalTx>>() {
-                @Override public void apply(IgniteInternalFuture<IgniteInternalTx> igniteTxIgniteFuture) {
-                    sendReply(nodeId, req);
-                }
-            });
+        if (req.replyRequired()) {
+            IgniteInternalFuture completeFut;
+
+            IgniteInternalFuture<IgniteInternalTx> dhtFin = dhtTx == null ? null : dhtTx.done() ? null : dhtTx.finishFuture();
+            IgniteInternalFuture<IgniteInternalTx> nearFin = nearTx == null ? null : nearTx.done() ? null : nearTx.finishFuture();
+
+            if (dhtFin != null && nearFin != null) {
+                GridCompoundFuture fut = new GridCompoundFuture();
+
+                fut.add(dhtFin);
+                fut.add(nearFin);
+
+                fut.markInitialized();
+
+                completeFut = fut;
+            }
+            else
+                completeFut = dhtFin != null ? dhtFin : nearFin;
+
+            if (completeFut != null) {
+                completeFut.listen(new CI1<IgniteInternalFuture<IgniteInternalTx>>() {
+                    @Override
+                    public void apply(IgniteInternalFuture<IgniteInternalTx> igniteTxIgniteFuture) {
+                        sendReply(nodeId, req);
+                    }
+                });
+            }
+            else
+                sendReply(nodeId, req);
         }
-        else
-            sendReply(nodeId, req);
     }
 
     /**
@@ -874,21 +928,19 @@ public class IgniteTxHandler {
      * @param req Request.
      */
     protected void sendReply(UUID nodeId, GridDhtTxFinishRequest req) {
-        if (req.replyRequired()) {
-            GridCacheMessage res = new GridDhtTxFinishResponse(req.version(), req.futureId(), req.miniId());
+        GridCacheMessage res = new GridDhtTxFinishResponse(req.version(), req.futureId(), req.miniId());
 
-            try {
-                ctx.io().send(nodeId, res, req.system() ? UTILITY_CACHE_POOL : SYSTEM_POOL);
-            }
-            catch (Throwable e) {
-                // Double-check.
-                if (ctx.discovery().node(nodeId) == null) {
-                    if (log.isDebugEnabled())
-                        log.debug("Node left while sending finish response [nodeId=" + nodeId + ", res=" + res + ']');
-                }
-                else
-                    U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", res=" + res + ']', e);
+        try {
+            ctx.io().send(nodeId, res, req.system() ? UTILITY_CACHE_POOL : SYSTEM_POOL);
+        }
+        catch (Throwable e) {
+            // Double-check.
+            if (ctx.discovery().node(nodeId) == null) {
+                if (log.isDebugEnabled())
+                    log.debug("Node left while sending finish response [nodeId=" + nodeId + ", res=" + res + ']');
             }
+            else
+                U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", res=" + res + ']', e);
         }
     }
 
@@ -942,6 +994,16 @@ public class IgniteTxHandler {
 
                     return null;
                 }
+
+                if (ctx.discovery().node(nodeId) == null) {
+                    tx.state(ROLLING_BACK);
+
+                    tx.state(ROLLED_BACK);
+
+                    ctx.tm().uncommitTx(tx);
+
+                    return null;
+                }
             }
 
             if (!tx.isSystemInvalidate() && !F.isEmpty(req.writes())) {


[43/50] [abbrv] incubator-ignite git commit: # patch-scripts: review

Posted by ag...@apache.org.
# patch-scripts: 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/a95e8de4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a95e8de4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a95e8de4

Branch: refs/heads/ignite-674
Commit: a95e8de4377eeb6a840031d0254096f063590d36
Parents: 015420f
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 18:55:48 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 18:55:48 2015 +0300

----------------------------------------------------------------------
 scripts/git-apply-patch.sh     | 32 +++++++++++++----------
 scripts/git-format-patch.sh    | 35 +++++++++++++------------
 scripts/git-patch-functions.sh | 51 ++++++++++++++++++++++++++++++++-----
 scripts/git-patch-prop.sh      | 10 +++-----
 4 files changed, 86 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-apply-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh
old mode 100644
new mode 100755
index 448421b..500b0a5
--- a/scripts/git-apply-patch.sh
+++ b/scripts/git-apply-patch.sh
@@ -17,7 +17,7 @@
 #
 
 #
-# Git patch-file applyer.
+# Git patch-file applier.
 #
 echo 'Usage: scripts/git-apply-patch.sh <ignite-task> [-ih|--ignitehome <path>] [-idb|--ignitedefbranch <branch-name>] [-ph|--patchhome <path>]'
 echo "It should be called from IGNITE_HOME directory."
@@ -26,6 +26,20 @@ echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set yo
 echo
 
 #
+# Init home and import properties and functions.
+#
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+#
 # Ignite task.
 #
 IGNITE_TASK=$1
@@ -42,32 +56,24 @@ do
         IGNITE_HOME="$2"
         shift
         ;;
+        
         -idb|--ignitedefbranch)
         IGNITE_DEFAULT_BRANCH="$2"
         shift
         ;;
+        
         -ph|--patchhome)
         PATCHES_HOME="$2"
         shift
         ;;
         *)
-                # unknown option
+        
+        echo "Unknown parameter: ${key}"
         ;;
     esac
     shift
 done
 
-if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
-    then IGNITE_HOME=$PWD
-fi
-
-. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
-. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
-
-if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
-    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
-fi
-
 echo "IGNITE_HOME    : ${IGNITE_HOME}"
 echo "Master branch  : ${IGNITE_DEFAULT_BRANCH}"
 echo "Ignite task    : ${IGNITE_TASK}"

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-format-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-format-patch.sh b/scripts/git-format-patch.sh
old mode 100644
new mode 100755
index 575a7bb..970347f
--- a/scripts/git-format-patch.sh
+++ b/scripts/git-format-patch.sh
@@ -26,6 +26,20 @@ echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set yo
 echo
 
 #
+# Init home and import properties and functions.
+#
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+#
 # Read command line params.
 #
 while [[ $# > 1 ]]
@@ -37,35 +51,24 @@ do
         IGNITE_HOME="$2"
         shift
         ;;
+        
         -idb|--ignitedefbranch)
         IGNITE_DEFAULT_BRANCH="$2"
         shift
         ;;
+        
         -ph|--patchhome)
         PATCHES_HOME="$2"
         shift
         ;;
+        
         *)
-                # unknown option
+        echo "Unknown parameter: ${key}"
         ;;
     esac
     shift
 done
 
-#
-# Init home and import properties and functions.
-#
-if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
-    then IGNITE_HOME=$PWD
-fi
-
-. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
-. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
-
-if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
-    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
-fi
-
 IGNITE_CURRENT_BRANCH=$( determineCurrentBranch ${IGNITE_HOME} )
 
 echo "IGNITE_HOME    : ${IGNITE_HOME}"
@@ -81,4 +84,4 @@ echo
 
 requireCleanWorkTree ${IGNITE_HOME}
 
-formatPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_CURRENT_BRANCH} _ignite.patch
\ No newline at end of file
+formatPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_CURRENT_BRANCH} .patch
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-patch-functions.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-functions.sh b/scripts/git-patch-functions.sh
index ab9bec3..796bccd 100644
--- a/scripts/git-patch-functions.sh
+++ b/scripts/git-patch-functions.sh
@@ -23,6 +23,16 @@
 #
 # Define functions.
 #
+
+#
+# Formats patch. Create patch in one commit from user who run script and with default comment.
+#
+# Params:
+# - Git home.
+# - Default branch.
+# - Patch with patch.
+# - Suffix for created patch-file.
+#
 formatPatch () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2
@@ -33,11 +43,10 @@ formatPatch () {
 
     git checkout ${DEFAULT_BRANCH}
     git checkout -b tmppatch
-    
-    git merge --no-edit ${PATCHED_BRANCH}
-#    Or we can 'squashe' merge to make only one commit.
-#    git merge --squash ${PATCHED_BRANCH}
-#    git commit -a -m "# PATCHED_BRANCH"
+
+    # Merge to make only one commit.
+    git merge --squash ${PATCHED_BRANCH}
+    git commit -a -m "# ${PATCHED_BRANCH}"
 
     PATCH_FILE=${PATCHES_HOME}'/'${DEFAULT_BRANCH}_${PATCHED_BRANCH}${PATCH_SUFFIX}
 
@@ -52,6 +61,13 @@ formatPatch () {
     echo "Patch created: ${PATCH_FILE}"
 }
 
+#
+# Determines current branch.
+#
+# Params:
+# - Git home.
+# Return - Current branch.
+#
 determineCurrentBranch () {
     GIT_HOME=$1
     
@@ -62,6 +78,13 @@ determineCurrentBranch () {
     echo "$CURRENT_BRANCH"
 }
 
+#
+# Checks that given git repository has clean work tree (there is no uncommited changes).
+# Exit with code 1 in error case.
+#
+# Params:
+# - Git home.
+#
 requireCleanWorkTree () {
     cd $1 # At git home.
 
@@ -94,6 +117,14 @@ requireCleanWorkTree () {
     fi
 }
 
+#
+# Applies patch. Applies patch file created by formatPatch method.
+#
+# Params:
+# - Git home.
+# - Default branch.
+# - File with patch.
+#
 applyPatch () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2
@@ -110,10 +141,18 @@ applyPatch () {
     fi
 
     echo "Patch $PATCH_FILE will be applied to $DEFAULT_BRANCH branch."
-#    git apply ${PATCH_FILE}
+    
     git am ${PATCH_FILE}
 }
 
+#
+# Checks that given default branch and current branch are equal.
+# Exit with code 1 in error case.
+#
+# Params:
+# - Git home.
+# - Default branch.
+#
 currentAndDefaultBranchesShouldBeEqual () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-patch-prop.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-prop.sh b/scripts/git-patch-prop.sh
index 7eb3639..9c52583 100644
--- a/scripts/git-patch-prop.sh
+++ b/scripts/git-patch-prop.sh
@@ -17,12 +17,8 @@
 #
 
 #
-# Git patch-file maker/applyer properties.
+# Git patch-file maker/applier properties.
 #
-if [ "${IGNITE_DEFAULT_BRANCH}" = "" ]
-    then IGNITE_DEFAULT_BRANCH='sprint-2'
-fi
+IGNITE_DEFAULT_BRANCH='ignite-sprint-3'
 
-if [ "${PATCHES_HOME}" = "" ]
-    then PATCHES_HOME=${GG_HOME}
-fi
\ No newline at end of file
+PATCHES_HOME=${IGNITE_HOME}


[38/50] [abbrv] incubator-ignite git commit: # ignite-598: fix bugs and support remote validation.

Posted by ag...@apache.org.
# ignite-598: fix bugs and support remote 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/c280901d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c280901d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c280901d

Branch: refs/heads/ignite-674
Commit: c280901d67d7273573f4bf326d8d7304523d28be
Parents: b78dbff
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 17:10:05 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 17:10:05 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |  2 +-
 .../ignite/internal/GridCachePluginContext.java |  6 ++
 .../processors/cache/GridCacheProcessor.java    | 64 +++++++++++++-------
 .../processors/plugin/CachePluginManager.java   | 51 ++++++++++++----
 .../ignite/plugin/CachePluginContext.java       | 11 ++++
 .../ignite/plugin/CachePluginProvider.java      |  4 +-
 6 files changed, 101 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/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 22148ad..f7f8e26 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
@@ -407,7 +407,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
     }
 
     /**
-     * Cache name. If not provided or {@code null}, then this will be considered a default
+     * Cache name or {@code null} if not provided, then this will be considered a default
      * cache which can be accessed via {@link Ignite#cache(String)} method. Otherwise, if name
      * is provided, the cache will be accessed via {@link Ignite#cache(String)} method.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/modules/core/src/main/java/org/apache/ignite/internal/GridCachePluginContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridCachePluginContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridCachePluginContext.java
index 2334bae..7c80db6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridCachePluginContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridCachePluginContext.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.plugin.*;
 
@@ -64,6 +65,11 @@ public class GridCachePluginContext<C extends CachePluginConfiguration> implemen
     @Override public Ignite grid() {        
         return ctx.grid();
     }
+    
+    /** {@inheritDoc} */
+    @Override public ClusterNode localNode() {
+        return ctx.discovery().localNode();
+    }
 
     /** {@inheritDoc} */
     @Override public IgniteLogger log(Class<?> cls) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/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 c366520..f21eabc 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
@@ -627,6 +627,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
         ClusterNode locNode = ctx.discovery().localNode();
 
+        // Init cache plugin managers.
+        final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
+
+        for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+            CacheConfiguration locCcfg = desc.cacheConfiguration();
+            
+            CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
+
+            cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
+        }
+        
         if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
             for (ClusterNode n : ctx.discovery().remoteNodes()) {
                 checkTransactionConfiguration(n);
@@ -640,8 +651,18 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 for (DynamicCacheDescriptor desc : registeredCaches.values()) {
                     CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
 
-                    if (rmtCfg != null)
-                        checkCache(desc.cacheConfiguration(), rmtCfg, n);
+                    if (rmtCfg != null) {
+                        CacheConfiguration locCfg = desc.cacheConfiguration();
+                        
+                        checkCache(locCfg, rmtCfg, n);
+
+                        // Check plugin cache configurations.
+                        CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
+
+                        assert pluginMgr != null : " Map=" + cache2PluginMgr;
+
+                        pluginMgr.validateRemotes(rmtCfg, n);
+                    }
                 }
             }
         }
@@ -661,7 +682,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             if (filter.apply(locNode)) {
                 CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
-                GridCacheContext ctx = createCache(ccfg, cacheObjCtx);
+                CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
+                
+                assert pluginMgr != null : " Map=" + cache2PluginMgr;
+                
+                GridCacheContext ctx = createCache(ccfg, pluginMgr, cacheObjCtx);
 
                 ctx.dynamicDeploymentId(desc.deploymentId());
 
@@ -975,17 +1000,24 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /**
      * @param cfg Cache configuration to use to create cache.
+     * @param pluginMgr Cache plugin manager.
      * @return Cache context.
      * @throws IgniteCheckedException If failed to create cache.
      */
     @SuppressWarnings({"unchecked"})
-    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg, CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
+    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg, @Nullable CachePluginManager pluginMgr,
+        CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
         assert cfg != null;
 
         CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
 
         validate(ctx.config(), cfg, cfgStore);
 
+        if (pluginMgr == null)
+            pluginMgr = new CachePluginManager(ctx, cfg);
+
+        pluginMgr.validate();
+
         CacheJtaManagerAdapter jta = JTA.create(cfg.getTransactionManagerLookupClassName() == null);
 
         jta.createTmLookup(cfg);
@@ -1017,16 +1049,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         CacheContinuousQueryManager contQryMgr = new CacheContinuousQueryManager();
         CacheDataStructuresManager dataStructuresMgr = new CacheDataStructuresManager();
         GridCacheTtlManager ttlMgr = new GridCacheTtlManager();
-        CachePluginManager pluginMgr = new CachePluginManager(ctx, cfg);
         
-        pluginMgr.validate();
-
-        CacheConflictResolutionManager rslvrMgr = pluginMgr.createComponent(ctx, cfg,
-            CacheConflictResolutionManager.class);
-
-        GridCacheDrManager drMgr = pluginMgr.createComponent(ctx, cfg,GridCacheDrManager.class);
-
-        CacheStoreManager storeMgr = pluginMgr.createComponent(ctx, cfg, CacheStoreManager.class);
+        CacheConflictResolutionManager rslvrMgr = pluginMgr.createComponent(CacheConflictResolutionManager.class);
+        GridCacheDrManager drMgr = pluginMgr.createComponent(GridCacheDrManager.class);
+        CacheStoreManager storeMgr = pluginMgr.createComponent(CacheStoreManager.class);
 
         storeMgr.initialize(cfgStore, sesHolders);
 
@@ -1156,7 +1182,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             evictMgr = new GridCacheEvictionManager();
             evtMgr = new GridCacheEventManager();
             pluginMgr = new CachePluginManager(ctx, cfg);
-            drMgr = pluginMgr.createComponent(ctx, cfg, GridCacheDrManager.class);
+            drMgr = pluginMgr.createComponent(GridCacheDrManager.class);
 
             cacheCtx = new GridCacheContext(
                 ctx,
@@ -1358,7 +1384,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
-            GridCacheContext cacheCtx = createCache(ccfg, cacheObjCtx);
+            GridCacheContext cacheCtx = createCache(ccfg, null, cacheObjCtx);
 
             cacheCtx.startTopologyVersion(topVer);
 
@@ -2028,14 +2054,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     true);
             }
         }
-        
-        // TODO 10006: implement remote configs validation.
-        // Check plugin configurations.
-//        for (CachePluginConfiguration locPluginCcfg : locCfg.getPluginConfigurations()) {
-//            CachePluginProvider provider = ...;
-//
-//            provider.validateRemote(locCfg, locPluginCcfg, rmtCfg, rmtNode);
-//        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
index 580ff49..640271a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.plugin;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
@@ -31,60 +32,71 @@ import java.util.*;
  * Cache plugin manager.
  */
 public class CachePluginManager extends GridCacheManagerAdapter {
+    /** Providers list. To have providers order. */
+    private final List<CachePluginProvider> providersList = new ArrayList<>();
+
+    /** */
+    private final Map<CachePluginContext, CachePluginProvider> providersMap = new HashMap<>();
+
     /** */
-    private final List<CachePluginProvider> providers = new ArrayList<>();
+    private final GridKernalContext ctx;
+
+    /** */
+    private final CacheConfiguration cfg;
 
     /**
      * @param ctx Context.
      * @param cfg Cache config.
      */
     public CachePluginManager(GridKernalContext ctx, CacheConfiguration cfg) {
+        this.ctx = ctx;
+        this.cfg = cfg;
+        
         if (cfg.getPluginConfigurations() != null) {
             for (CachePluginConfiguration cachePluginCfg : cfg.getPluginConfigurations()) {
                 CachePluginContext pluginCtx = new GridCachePluginContext(ctx, cfg, cachePluginCfg);
 
                 CachePluginProvider provider = cachePluginCfg.createProvider(pluginCtx);
 
-                providers.add(provider);
+                providersList.add(provider);
+                providersMap.put(pluginCtx, provider);
             }
         }
     }
 
     /** {@inheritDoc} */
     @Override protected void onKernalStart0() throws IgniteCheckedException {
-        for (CachePluginProvider provider : providers)
+        for (CachePluginProvider provider : providersList)
             provider.onIgniteStart();
     }
 
     /** {@inheritDoc} */
     @Override protected void onKernalStop0(boolean cancel) {
-        for (ListIterator<CachePluginProvider> iter = providers.listIterator(); iter.hasPrevious();)
+        for (ListIterator<CachePluginProvider> iter = providersList.listIterator(); iter.hasPrevious();)
             iter.previous().onIgniteStop(cancel);
     }
 
     /** {@inheritDoc} */
     @Override protected void start0() throws IgniteCheckedException {
-        for (CachePluginProvider provider : providers)
+        for (CachePluginProvider provider : providersList)
             provider.start();
     }
 
     /** {@inheritDoc} */
     @Override protected void stop0(boolean cancel) {
-        for (ListIterator<CachePluginProvider> iter = providers.listIterator(); iter.hasPrevious();)
+        for (ListIterator<CachePluginProvider> iter = providersList.listIterator(); iter.hasPrevious();)
             iter.previous().stop(cancel);
     }
 
     /**
      * Creates optional component.
      *
-     * @param ctx Kernal context.
-     * @param cfg Cache configuration.
      * @param cls Component class.
      * @return Created component.
      */
     @SuppressWarnings("unchecked")
-    public <T> T createComponent(GridKernalContext ctx, CacheConfiguration cfg, Class<T> cls) {
-        for (CachePluginProvider provider : providers) {
+    public <T> T createComponent(Class<T> cls) {
+        for (CachePluginProvider provider : providersList) {
             T res = (T)provider.createComponent(cls);
             
             if (res != null)
@@ -107,7 +119,24 @@ public class CachePluginManager extends GridCacheManagerAdapter {
      * @throws IgniteCheckedException If validation failed.
      */
     public void validate() throws IgniteCheckedException {
-        for (CachePluginProvider provider : providers)
+        for (CachePluginProvider provider : providersList)
             provider.validate();
     }
+
+    /**
+     * Checks that remote caches has configuration compatible with the local.
+     *    
+     * @param rmtCfg Remote cache configuration.
+     * @param rmtNode Remote rmtNode.
+     * @throws IgniteCheckedException If failed.
+     */
+    @SuppressWarnings("unchecked")
+    public void validateRemotes(CacheConfiguration rmtCfg, ClusterNode rmtNode) throws IgniteCheckedException {
+        for (Map.Entry<CachePluginContext, CachePluginProvider> entry : providersMap.entrySet()) {
+            CachePluginContext cctx = entry.getKey();
+            CachePluginProvider provider = entry.getValue();
+            
+            provider.validateRemote(cctx.igniteCacheConfiguration(), cctx.cacheConfiguration(), rmtCfg, rmtNode);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginContext.java b/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginContext.java
index 580b40d..f034312 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginContext.java
@@ -18,7 +18,9 @@
 package org.apache.ignite.plugin;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.DiscoverySpi;
 
 /**
  * Cache plugin context.
@@ -45,6 +47,15 @@ public interface CachePluginContext<C extends CachePluginConfiguration> {
     public Ignite grid();
 
     /**
+     * Gets local grid node. Instance of local node is provided by underlying {@link DiscoverySpi}
+     * implementation used.
+     *
+     * @return Local grid node.
+     * @see DiscoverySpi
+     */
+    public ClusterNode localNode();
+
+    /**
      * Gets logger for given class.
      *
      * @param cls Class to get logger for.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c280901d/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginProvider.java
index 4006a70..ea5f795 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/CachePluginProvider.java
@@ -77,8 +77,8 @@ public interface CachePluginProvider<C extends CachePluginConfiguration> {
      * @param locCfg Local configuration.
      * @param locPluginCcfg Local plugin configuration.
      * @param rmtCfg Remote configuration.
-     * @param node Node.
+     * @param rmtNode Remote node.
      */
-    public void validateRemote(CacheConfiguration locCfg, C locPluginCcfg, CacheConfiguration rmtCfg, ClusterNode node) 
+    public void validateRemote(CacheConfiguration locCfg, C locPluginCcfg, CacheConfiguration rmtCfg, ClusterNode rmtNode)
         throws IgniteCheckedException;
 }


[19/50] [abbrv] incubator-ignite git commit: # ignite-670 more tests, use default expiry policy from isolated updater

Posted by ag...@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-674
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));
         }
     }
 }


[17/50] [abbrv] incubator-ignite git commit: ignite-645 review fixes

Posted by ag...@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-674
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);
 


[13/50] [abbrv] incubator-ignite git commit: Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002

Posted by ag...@apache.org.
Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002


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

Branch: refs/heads/ignite-674
Commit: acb5d2b4c59bd6e17144195e36092f1cd41aaa96
Parents: aabe5a9 505a7bf
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Apr 2 10:42:21 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Apr 2 10:42:21 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/IgniteCacheAffinitySelfTest.java  |  2 ++
 .../cache/GridCacheOnCopyFlagAbstractSelfTest.java  | 16 +++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[42/50] [abbrv] incubator-ignite git commit: ignite-sprint-3 - minor fix for query events

Posted by ag...@apache.org.
ignite-sprint-3 - minor fix for query events


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

Branch: refs/heads/ignite-674
Commit: cef5227afb48638c1c4aa0ce26eaaa2244a5edc1
Parents: ea777d4
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Apr 3 18:38:02 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Apr 3 18:38:02 2015 +0300

----------------------------------------------------------------------
 .../ignite/events/CacheQueryExecutedEvent.java    | 11 +++++------
 .../apache/ignite/events/CacheQueryReadEvent.java | 11 +++++------
 .../cache/query/GridCacheQueryManager.java        | 18 +++++++++---------
 .../continuous/CacheContinuousQueryHandler.java   |  4 ++--
 .../processors/query/GridQueryProcessor.java      |  4 ++--
 .../GridCacheContinuousQueryAbstractSelfTest.java |  4 ++--
 .../query/h2/twostep/GridMapQueryExecutor.java    |  4 ++--
 .../cache/IgniteCacheAbstractQuerySelfTest.java   |  8 ++++----
 8 files changed, 31 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
index 04f83c2..22892bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
@@ -19,10 +19,9 @@ package org.apache.ignite.events;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
@@ -67,7 +66,7 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
     private static final long serialVersionUID = 3738753361235304496L;
 
     /** Query type. */
-    private final CacheQueryType qryType;
+    private final String qryType;
 
     /** Cache name. */
     private final String cacheName;
@@ -112,7 +111,7 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
         ClusterNode node,
         String msg,
         int type,
-        CacheQueryType qryType,
+        String qryType,
         @Nullable String cacheName,
         @Nullable String clsName,
         @Nullable String clause,
@@ -139,9 +138,9 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type.
+     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
      */
-    public CacheQueryType queryType() {
+    public String queryType() {
         return qryType;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
index a399d8a..78acdc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
@@ -19,10 +19,9 @@ package org.apache.ignite.events;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
@@ -67,7 +66,7 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
     private static final long serialVersionUID = -1984731272984397445L;
 
     /** Query type. */
-    private final CacheQueryType qryType;
+    private final String qryType;
 
     /** Cache name. */
     private final String cacheName;
@@ -130,7 +129,7 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
         ClusterNode node,
         String msg,
         int type,
-        CacheQueryType qryType,
+        String qryType,
         @Nullable String cacheName,
         @Nullable String clsName,
         @Nullable String clause,
@@ -165,9 +164,9 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type.
+     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
      */
-    public CacheQueryType queryType() {
+    public String queryType() {
         return qryType;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 6c8cf9a..d571243 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -511,7 +511,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "SQL query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SQL,
+                            CacheQueryType.SQL.name(),
                             cctx.namex(),
                             qry.queryClassName(),
                             qry.clause(),
@@ -533,7 +533,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "Scan query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SCAN,
+                            CacheQueryType.SCAN.name(),
                             cctx.namex(),
                             null,
                             null,
@@ -554,7 +554,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "Full text query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.FULL_TEXT,
+                            CacheQueryType.FULL_TEXT.name(),
                             cctx.namex(),
                             qry.queryClassName(),
                             qry.clause(),
@@ -628,7 +628,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     cctx.localNode(),
                     "SQL fields query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SQL_FIELDS,
+                    CacheQueryType.SQL_FIELDS.name(),
                     cctx.namex(),
                     null,
                     qry.clause(),
@@ -660,7 +660,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     cctx.localNode(),
                     "SPI query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SPI,
+                    CacheQueryType.SPI.name(),
                     cctx.namex(),
                     null,
                     null,
@@ -1119,7 +1119,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "SQL fields query result set row read.",
                             EVT_CACHE_QUERY_OBJECT_READ,
-                            CacheQueryType.SQL_FIELDS,
+                            CacheQueryType.SQL_FIELDS.name(),
                             cctx.namex(),
                             null,
                             qry.clause(),
@@ -1318,7 +1318,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "SQL query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.SQL,
+                                    CacheQueryType.SQL.name(),
                                     cctx.namex(),
                                     qry.queryClassName(),
                                     qry.clause(),
@@ -1339,7 +1339,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "Full text query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.FULL_TEXT,
+                                    CacheQueryType.FULL_TEXT.name(),
                                     cctx.namex(),
                                     qry.queryClassName(),
                                     qry.clause(),
@@ -1360,7 +1360,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "Scan query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.SCAN,
+                                    CacheQueryType.SCAN.name(),
                                     cctx.namex(),
                                     null,
                                     null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 1fd1ded..ad78b92 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -172,7 +172,7 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
                         ctx.discovery().localNode(),
                         "Continuous query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.CONTINUOUS,
+                        CacheQueryType.CONTINUOUS.name(),
                         cacheName,
                         null,
                         null,
@@ -236,7 +236,7 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
                             ctx.discovery().localNode(),
                             "Continuous query executed.",
                             EVT_CACHE_QUERY_OBJECT_READ,
-                            CacheQueryType.CONTINUOUS,
+                            CacheQueryType.CONTINUOUS.name(),
                             cacheName,
                             null,
                             null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 048a0c8..ba8479f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -564,7 +564,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     ctx.discovery().localNode(),
                     "SQL query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SQL,
+                    CacheQueryType.SQL.name(),
                     null,
                     null,
                     sqlQry,
@@ -631,7 +631,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                         ctx.discovery().localNode(),
                         "SQL query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         null,
                         null,
                         sql,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index a22e0c7..5a78f9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -909,7 +909,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
 
                 CacheQueryReadEvent qe = (CacheQueryReadEvent)evt;
 
-                assertEquals(CONTINUOUS, qe.queryType());
+                assertEquals(CONTINUOUS.name(), qe.queryType());
                 assertNull(qe.cacheName());
 
                 assertEquals(grid(0).localNode().id(), qe.subjectId());
@@ -933,7 +933,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
 
                 CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                assertEquals(CONTINUOUS, qe.queryType());
+                assertEquals(CONTINUOUS.name(), qe.queryType());
                 assertNull(qe.cacheName());
 
                 assertEquals(grid(0).localNode().id(), qe.subjectId());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 959d1cc..08ad38d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -209,7 +209,7 @@ public class GridMapQueryExecutor implements GridMessageListener {
                         node,
                         "SQL query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         cctx.namex(),
                         null,
                         qry.query(),
@@ -537,7 +537,7 @@ public class GridMapQueryExecutor implements GridMessageListener {
                         cctx.localNode(),
                         "SQL fields query result set row read.",
                         EVT_CACHE_QUERY_OBJECT_READ,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         cctx.namex(),
                         null,
                         qry.query(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 88effe1..3dcf9ac 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -1004,7 +1004,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryReadEvent<Integer, Integer> qe = (CacheQueryReadEvent<Integer, Integer>)evt;
 
-                    assertEquals(SCAN, qe.queryType());
+                    assertEquals(SCAN.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertNull(qe.className());
@@ -1027,7 +1027,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                    assertEquals(SCAN, qe.queryType());
+                    assertEquals(SCAN.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertNull(qe.className());
@@ -1080,7 +1080,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryReadEvent<UUID, Person> qe = (CacheQueryReadEvent<UUID, Person>)evt;
 
-                    assertEquals(FULL_TEXT, qe.queryType());
+                    assertEquals(FULL_TEXT.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertEquals("Person", qe.className());
@@ -1103,7 +1103,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                    assertEquals(FULL_TEXT, qe.queryType());
+                    assertEquals(FULL_TEXT.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertEquals("Person", qe.className());


[47/50] [abbrv] incubator-ignite git commit: IGNITE-674 - Merging 6.6.4 fixes to Ignite.

Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 10146a4..125e4cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -60,7 +60,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     private static final long serialVersionUID = 0L;
 
     /** Per-transaction read map. */
-    @GridToStringExclude
+    @GridToStringInclude
     protected Map<IgniteTxKey, IgniteTxEntry> txMap;
 
     /** Read view on transaction map. */
@@ -2646,14 +2646,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                 if (fut.isDone()) {
                     try {
-                        return plc1.apply(fut.get(), null);
+                        return nonInterruptable(plc1.apply(fut.get(), null));
                     }
                     catch (GridClosureException e) {
                         return new GridFinishedFuture<>(e.unwrap());
                     }
                     catch (IgniteCheckedException e) {
                         try {
-                            return plc1.apply(false, e);
+                            return nonInterruptable(plc1.apply(false, e));
                         }
                         catch (Exception e1) {
                             return new GridFinishedFuture<>(e1);
@@ -2661,10 +2661,10 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     }
                 }
                 else
-                    return new GridEmbeddedFuture<>(
+                    return nonInterruptable(new GridEmbeddedFuture<>(
                         fut,
                         plc1
-                    );
+                    ));
             }
             else {
                 if (implicit()) {
@@ -2679,22 +2679,24 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                         return new GridFinishedFuture<>(e);
                     }
 
-                    return commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
-                        @Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut) throws IgniteCheckedException {
+                    return nonInterruptable(commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
+                        @Override
+                        public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut) throws IgniteCheckedException {
                             txFut.get();
 
                             return implicitRes;
                         }
-                    });
+                    }));
                 }
                 else
-                    return loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
-                        @Override public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f) throws IgniteCheckedException {
+                    return nonInterruptable(loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
+                        @Override
+                        public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f) throws IgniteCheckedException {
                             f.get();
 
                             return ret;
                         }
-                    });
+                    }));
             }
         }
         catch (RuntimeException e) {
@@ -2866,14 +2868,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                 if (fut.isDone()) {
                     try {
-                        return plc1.apply(fut.get(), null);
+                        return nonInterruptable(plc1.apply(fut.get(), null));
                     }
                     catch (GridClosureException e) {
                         return new GridFinishedFuture<>(e.unwrap());
                     }
                     catch (IgniteCheckedException e) {
                         try {
-                            return plc1.apply(false, e);
+                            return nonInterruptable(plc1.apply(false, e));
                         }
                         catch (Exception e1) {
                             return new GridFinishedFuture<>(e1);
@@ -2881,10 +2883,10 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     }
                 }
                 else
-                    return new GridEmbeddedFuture<>(
+                    return nonInterruptable(new GridEmbeddedFuture<>(
                         fut,
                         plc1
-                    );
+                    ));
             }
             else {
                 if (implicit()) {
@@ -2892,26 +2894,26 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     // with prepare response, if required.
                     assert loadFut.isDone();
 
-                    return commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
-                        @Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
-                            throws IgniteCheckedException
-                        {
+                    return nonInterruptable(commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
+                        @Override
+                        public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
+                            throws IgniteCheckedException {
                             txFut.get();
 
                             return (GridCacheReturn)implicitRes;
                         }
-                    });
+                    }));
                 }
                 else
-                    return loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
-                        @Override public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
-                            throws IgniteCheckedException
-                        {
+                    return nonInterruptable(loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
+                        @Override
+                        public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
+                            throws IgniteCheckedException {
                             f.get();
 
                             return ret;
                         }
-                    });
+                    }));
             }
         }
         catch (IgniteCheckedException e) {
@@ -2922,6 +2924,18 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     }
 
     /**
+     * @param fut Future.
+     * @return Future ignoring interrupts on {@code get()}.
+     */
+    private <T> IgniteInternalFuture<T> nonInterruptable(IgniteInternalFuture<T> fut) {
+        // Safety.
+        if (fut instanceof GridFutureAdapter)
+            ((GridFutureAdapter)fut).ignoreInterrupts(true);
+
+        return fut;
+    }
+
+    /**
      * Checks if portable values should be deserialized.
      *
      * @param cacheCtx Cache context.
@@ -3264,7 +3278,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
             if (explicitCand != null) {
                 GridCacheVersion explicitVer = explicitCand.version();
 
-                if (!explicitVer.equals(xidVer) && explicitCand.threadId() == threadId && !explicitCand.tx()) {
+                boolean locCand = false;
+
+                if (explicitCand.nearLocal())
+                    locCand = cctx.localNodeId().equals(explicitCand.nodeId());
+                else if (explicitCand.dhtLocal())
+                    locCand = cctx.localNodeId().equals(explicitCand.otherNodeId());
+
+                if (!explicitVer.equals(xidVer) && explicitCand.threadId() == threadId && !explicitCand.tx() && locCand) {
                     txEntry.explicitVersion(explicitVer);
 
                     if (explicitVer.isLess(minVer))
@@ -3538,7 +3559,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                 if (!locked)
                     throw new GridClosureException(new IgniteTxTimeoutCheckedException("Failed to acquire lock " +
-                        "within provided timeout for transaction [timeout=" + timeout() + ", tx=" + this + ']'));
+                        "within provided timeout for transaction [timeout=" + timeout() +
+                        ", tx=" + IgniteTxLocalAdapter.this + ']'));
 
                 IgniteInternalFuture<T> fut = postLock();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index a8ff280..153c010 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -1016,6 +1016,13 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
     }
 
     /**
+     * @return Collection of active transactions.
+     */
+    public Collection<IgniteInternalTx> activeTransactions() {
+        return F.concat(false, idMap.values(), nearIdMap.values());
+    }
+
+    /**
      * @param xidVer Completed transaction version.
      * @param nearXidVer Optional near transaction ID.
      * @return If transaction was not already present in completed set.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
index dcd6b9b..a8a545d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
@@ -42,6 +42,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> {
     private final ConcurrentLinkedDeque8<IgniteInternalFuture<T>> futs = new ConcurrentLinkedDeque8<>();
 
     /** Pending futures. */
+    @GridToStringInclude
     private final Collection<IgniteInternalFuture<T>> pending = new ConcurrentLinkedDeque8<>();
 
     /** Listener call count. */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index f671a77..09cf63a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -64,6 +64,9 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
     private volatile long endTime;
 
     /** */
+    private boolean ignoreInterrupts;
+
+    /** */
     private IgniteInClosure<? super IgniteInternalFuture<R>> lsnr;
 
     /** {@inheritDoc} */
@@ -79,6 +82,13 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
     }
 
     /**
+     * @param ignoreInterrupts Ignore interrupts flag.
+     */
+    public void ignoreInterrupts(boolean ignoreInterrupts) {
+        this.ignoreInterrupts = ignoreInterrupts;
+    }
+
+    /**
      * @return Future end time.
      */
     public long endTime() {
@@ -98,8 +108,12 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
     /** {@inheritDoc} */
     @Override public R get() throws IgniteCheckedException {
         try {
-            if (endTime == 0)
-                acquireSharedInterruptibly(0);
+            if (endTime == 0) {
+                if (ignoreInterrupts)
+                    acquireShared(0);
+                else
+                    acquireSharedInterruptibly(0);
+            }
 
             if (getState() == CANCELLED)
                 throw new IgniteFutureCancelledCheckedException("Future was cancelled: " + this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
index bed0c8e..1dc682b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.util.worker;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
@@ -119,7 +120,10 @@ public abstract class GridWorker implements Runnable {
         // Catch everything to make sure that it gets logged properly and
         // not to kill any threads from the underlying thread pool.
         catch (Throwable e) {
-            U.error(log, "Runtime error caught during grid runnable execution: " + this, e);
+            if (!X.hasCause(e, InterruptedException.class) && !X.hasCause(e, IgniteInterruptedCheckedException.class) && !X.hasCause(e, IgniteInterruptedException.class))
+                U.error(log, "Runtime error caught during grid runnable execution: " + this, e);
+            else
+                U.warn(log, "Runtime exception occurred during grid runnable execution caused by thread interruption: " + e.getMessage());
         }
         finally {
             synchronized (mux) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheLockFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheLockFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheLockFailoverSelfTest.java
new file mode 100644
index 0000000..9f9ec60
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheLockFailoverSelfTest.java
@@ -0,0 +1,148 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ *
+ */
+@SuppressWarnings("unchecked")
+public class IgniteCacheLockFailoverSelfTest extends GridCacheAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 2;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        startGridsMultiThreaded(gridCount());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
+
+        ccfg.setNearConfiguration(null);
+
+        return ccfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected long getTestTimeout() {
+        return 2 * 60_000;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLockFailover() throws Exception {
+        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+
+        Integer key = backupKey(cache);
+
+        final AtomicBoolean stop = new AtomicBoolean();
+
+        IgniteInternalFuture<?> restartFut = GridTestUtils.runAsync(new Callable<Object>() {
+            @Override
+            public Object call() throws Exception {
+                while (!stop.get()) {
+                    stopGrid(1);
+
+                    U.sleep(500);
+
+                    startGrid(1);
+                }
+                return null;
+            }
+        });
+
+        try {
+            long end = System.currentTimeMillis() + 60_000;
+
+            long iter = 0;
+
+            while (System.currentTimeMillis() < end) {
+                if (iter % 100 == 0)
+                    log.info("Iteration: " + iter);
+
+                iter++;
+
+                GridCacheAdapter<Object, Object> adapter = ((IgniteKernal)grid(0)).internalCache(null);
+
+                IgniteInternalFuture<Boolean> fut = adapter.lockAsync(key, 0);
+
+                try {
+                    fut.get(30_000);
+
+                    U.sleep(1);
+                }
+                catch (IgniteFutureTimeoutException e) {
+                    info("Entry: " + adapter.peekEx(key));
+
+                    fail("Lock timeout [fut=" + fut + ", err=" + e + ']');
+                }
+                catch (Exception e) {
+                    log.error("Error: " + e);
+                }
+                finally {
+                    adapter.unlock(key);
+                }
+            }
+        }
+        finally {
+            stop.set(true);
+
+            restartFut.get();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testUnlockPrimaryLeft() throws Exception {
+        GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)grid(0)).internalCache(null);
+
+        Integer key = backupKey(grid(0).cache(null));
+
+        cache.lock(key, 0);
+
+        stopGrid(1);
+
+        cache.unlock(key);
+
+        GridCacheEntryEx entry = cache.peekEx(key);
+
+        assertTrue("Remote MVCC is not empty: " + entry, entry == null || entry.remoteMvccSnapshot().isEmpty());
+
+        startGrid(1);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
new file mode 100644
index 0000000..9aa89be
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
@@ -0,0 +1,217 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.eviction.lru.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.transactions.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+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 java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Tests explicit lock.
+ */
+public class IgniteCacheMultiTxLockSelfTest extends GridCommonAbstractTest {
+    /** */
+    public static final String CACHE_NAME = "part_cache";
+
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private volatile boolean run = true;
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        assertEquals(0, G.allGrids().size());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration c = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(ipFinder);
+
+        c.setDiscoverySpi(disco);
+
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        ccfg.setName(CACHE_NAME);
+        ccfg.setDefaultTimeToLive(120000);
+        ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
+        ccfg.setBackups(2);
+        ccfg.setCacheMode(CacheMode.PARTITIONED);
+        ccfg.setStartSize(100000);
+        ccfg.setEvictionPolicy(new LruEvictionPolicy(100000));
+        ccfg.setEvictSynchronized(true);
+
+        c.setCacheConfiguration(ccfg);
+
+        return c;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testExplicitLockOneKey() throws Exception {
+        checkExplicitLock(1);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testExplicitLockManyKeys() throws Exception {
+        checkExplicitLock(4);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void checkExplicitLock(int keys) throws Exception {
+        Collection<Thread> threads = new ArrayList<>();
+
+        try {
+            // Start grid 1.
+            IgniteEx grid1 = startGrid(1);
+
+            threads.add(runCacheOperations(grid1.cachex(CACHE_NAME), keys));
+
+            TimeUnit.SECONDS.sleep(3L);
+
+            // Start grid 2.
+            IgniteEx grid2 = startGrid(2);
+
+            threads.add(runCacheOperations(grid2.cachex(CACHE_NAME), keys));
+
+            TimeUnit.SECONDS.sleep(3L);
+
+            // Start grid 3.
+            IgniteEx grid3 = startGrid(3);
+
+            threads.add(runCacheOperations(grid3.cachex(CACHE_NAME), keys));
+
+            TimeUnit.SECONDS.sleep(3L);
+
+            // Start grid 4.
+            IgniteEx grid4 = startGrid(4);
+
+            threads.add(runCacheOperations(grid4.cachex(CACHE_NAME), keys));
+
+            TimeUnit.SECONDS.sleep(3L);
+
+            stopThreads(threads);
+
+            for (int i = 1; i <= 4; i++) {
+                IgniteTxManager tm = ((IgniteKernal)grid(i)).internalCache(CACHE_NAME).context().tm();
+
+                assertEquals("txMap is not empty:" + i, 0, tm.idMapSize());
+            }
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     * @param threads Thread which will be stopped.
+     */
+    private void stopThreads(Iterable<Thread> threads) {
+        try {
+            run = false;
+
+            for (Thread thread : threads)
+                thread.join();
+        }
+        catch (Exception e) {
+            U.error(log(), "Couldn't stop threads.", e);
+        }
+    }
+
+    /**
+     * @param cache Cache.
+     * @return Running thread.
+     */
+    @SuppressWarnings("TypeMayBeWeakened")
+    private Thread runCacheOperations(final GridCache<Object,Object> cache, final int keys) {
+        Thread t = new Thread() {
+            @Override public void run() {
+                while (run) {
+                    TreeMap<Integer, String> vals = generateValues(keys);
+
+                    try {
+                        // Explicit lock.
+                        U.debug(log, "Will lock key: " + vals.firstKey());
+
+                        cache.lock(vals.firstKey(), 0);
+
+                        try {
+                            U.debug(log, "Will run cache op: " + vals);
+
+                            // Put or remove.
+                            if (ThreadLocalRandom.current().nextDouble(1) < 0.65)
+                                cache.putAll(vals);
+                            else
+                                cache.removeAll(vals.keySet());
+                        }
+                        catch (Exception e) {
+                            U.error(log(), "Failed cache operation.", e);
+                        }
+                        finally {
+                            U.debug(log, "Will unlock key: " + vals.firstKey());
+                            cache.unlock(vals.firstKey());
+                        }
+
+                        U.sleep(100);
+                    }
+                    catch (Exception e){
+                        U.error(log(), "Failed unlock.", e);
+                    }
+                }
+            }
+        };
+
+        t.start();
+
+        return t;
+    }
+
+    /**
+     * @param cnt Number of keys to generate.
+     * @return Map.
+     */
+    private TreeMap<Integer, String> generateValues(int cnt) {
+        TreeMap<Integer, String> res = new TreeMap<>();
+
+        ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+        while (res.size() < cnt) {
+            int key = rnd.nextInt(0, 100);
+
+            res.put(key, String.valueOf(key));
+        }
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index da316fd..5fe49ed 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -621,8 +621,8 @@ public abstract class GridAbstractTest extends TestCase {
      * @return Started grid.
      * @throws Exception If anything failed.
      */
-    protected Ignite startGrid(int idx) throws Exception {
-        return startGrid(getTestGridName(idx));
+    protected IgniteEx startGrid(int idx) throws Exception {
+        return (IgniteEx)startGrid(getTestGridName(idx));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab01e7dd/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index a4553c4..61fc898 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -426,6 +426,9 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheTxStoreValueTest.class);
         suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class);
 
+        suite.addTestSuite(IgniteCacheLockFailoverSelfTest.class);
+        suite.addTestSuite(IgniteCacheMultiTxLockSelfTest.class);
+
         return suite;
     }
 }


[09/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-645

Posted by ag...@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-674
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
----------------------------------------------------------------------


[14/50] [abbrv] incubator-ignite git commit: 10002 review

Posted by ag...@apache.org.
10002 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/162bdac1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/162bdac1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/162bdac1

Branch: refs/heads/ignite-674
Commit: 162bdac1c1407cf870fb6b18ba3bb7440b1a300c
Parents: acb5d2b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu Apr 2 10:55:24 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Apr 2 10:55:24 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/query/GridQueryProcessor.java | 8 ++++++--
 .../query/h2/twostep/messages/GridQueryNextPageResponse.java | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/162bdac1/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 4e30f41..048a0c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -124,7 +124,10 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 desc.name(valCls != null ? typeName(valCls) : meta.getValueType());
 
                 desc.valueClass(valCls != null ? valCls : Object.class);
-                desc.keyClass(meta.getKeyType() == null ? Object.class : U.classForName(meta.getKeyType(), Object.class));
+                desc.keyClass(
+                    meta.getKeyType() == null ?
+                        Object.class :
+                        U.classForName(meta.getKeyType(), Object.class));
 
                 TypeId typeId;
 
@@ -1448,7 +1451,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             else {
                 int isKeyProp0 = isKeyProp;
 
-                if (isKeyProp0 == 0) { // Key is allowed to be a non-portable object here.
+                if (isKeyProp0 == 0) {
+                    // Key is allowed to be a non-portable object here.
                     // We check key before value consistently with ClassProperty.
                     if (ctx.cacheObjects().isPortableObject(key) && ctx.cacheObjects().hasField(key, propName))
                         isKeyProp = isKeyProp0 = 1;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/162bdac1/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
index 22f9cb4..b7b6f4c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.query.h2.twostep.messages;
 
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.plugin.extensions.communication.*;
 
@@ -46,6 +47,7 @@ public class GridQueryNextPageResponse implements Message {
     private byte[] rows;
 
     /** */
+    @GridDirectTransient
     private transient Object plainRows;
 
     /**


[05/50] [abbrv] incubator-ignite git commit: ignite-10009: Add tests.

Posted by ag...@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-674
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;
+    }
+}


[45/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' 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/5cc2d36e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5cc2d36e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5cc2d36e

Branch: refs/heads/ignite-674
Commit: 5cc2d36ebd4eb2a759220891ed8027d3641e2893
Parents: 9a523ce cef5227
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:23:34 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:23:34 2015 +0300

----------------------------------------------------------------------
 .../ignite/events/CacheQueryExecutedEvent.java    | 11 +++++------
 .../apache/ignite/events/CacheQueryReadEvent.java | 11 +++++------
 .../processors/cache/GridCacheMapEntry.java       |  4 ++--
 .../cache/query/GridCacheQueryManager.java        | 18 +++++++++---------
 .../continuous/CacheContinuousQueryHandler.java   |  4 ++--
 .../processors/query/GridQueryProcessor.java      |  4 ++--
 .../GridCacheContinuousQueryAbstractSelfTest.java |  4 ++--
 .../query/h2/twostep/GridMapQueryExecutor.java    |  4 ++--
 .../cache/IgniteCacheAbstractQuerySelfTest.java   |  8 ++++----
 9 files changed, 33 insertions(+), 35 deletions(-)
----------------------------------------------------------------------



[23/50] [abbrv] incubator-ignite git commit: # ignite-670

Posted by ag...@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-674
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));


[10/50] [abbrv] incubator-ignite git commit: # ignite-645 review

Posted by ag...@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-674
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);


[44/50] [abbrv] incubator-ignite git commit: # patch-scripts: review 2

Posted by ag...@apache.org.
# patch-scripts: review 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/9a523ceb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9a523ceb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9a523ceb

Branch: refs/heads/ignite-674
Commit: 9a523ceb1486b4b25dc47a6e0629681d1394d216
Parents: a95e8de
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:11:03 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:11:03 2015 +0300

----------------------------------------------------------------------
 scripts/git-apply-patch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a523ceb/scripts/git-apply-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh
index 500b0a5..c5f686f 100755
--- a/scripts/git-apply-patch.sh
+++ b/scripts/git-apply-patch.sh
@@ -89,6 +89,6 @@ currentAndDefaultBranchesShouldBeEqual ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH}
 
 requireCleanWorkTree ${IGNITE_HOME}
 
-IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}_ignite.patch
+IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}.patch
 
 applyPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_PATCH_FILE}


[26/50] [abbrv] incubator-ignite git commit: # Fixed JavaDoc issue.

Posted by ag...@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-674
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,


[25/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 Removed queryTimeout

Posted by ag...@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-674
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()))
 


[28/50] [abbrv] incubator-ignite git commit: # Minor fix to IGFS secondary file system arguments validation.

Posted by ag...@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-674
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;
 


[27/50] [abbrv] incubator-ignite git commit: Merge branch 'ignite-645' into ignite-sprint-3

Posted by ag...@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-674
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
----------------------------------------------------------------------


[41/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' 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/ea777d40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ea777d40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ea777d40

Branch: refs/heads/ignite-674
Commit: ea777d40f6a7e452b87a0ea592e8e0dea2e068f5
Parents: a28bc74 015420f
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 17:19:33 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 17:19:33 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |  2 +-
 .../ignite/internal/GridCachePluginContext.java |  6 ++
 .../processors/cache/GridCacheProcessor.java    | 64 +++++++++++++-------
 .../processors/plugin/CachePluginManager.java   | 51 ++++++++++++----
 .../ignite/plugin/CachePluginContext.java       | 11 ++++
 .../ignite/plugin/CachePluginProvider.java      |  4 +-
 .../org/apache/ignite/plugin/PluginContext.java |  9 +--
 7 files changed, 106 insertions(+), 41 deletions(-)
----------------------------------------------------------------------



[37/50] [abbrv] incubator-ignite git commit: minor

Posted by ag...@apache.org.
minor


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

Branch: refs/heads/ignite-674
Commit: e100341949e19883e25d37968ade163364cbaa1b
Parents: 3061522
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Apr 3 17:06:52 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Apr 3 17:06:52 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/plugin/PluginContext.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1003419/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java b/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
index 0704700..f2a972c 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.discovery.DiscoverySpi;
 
 import java.util.*;
 
@@ -45,20 +46,20 @@ public interface PluginContext {
 
     /**
      * Gets a collection of all grid nodes. Remote nodes are discovered via underlying
-     * {@link org.apache.ignite.spi.discovery.DiscoverySpi} implementation used.
+     * {@link DiscoverySpi} implementation used.
      *
      * @return Collection of grid nodes.
      * @see #localNode()
-     * @see org.apache.ignite.spi.discovery.DiscoverySpi
+     * @see DiscoverySpi
      */
     public Collection<ClusterNode> nodes();
 
     /**
-     * Gets local grid node. Instance of local node is provided by underlying {@link org.apache.ignite.spi.discovery.DiscoverySpi}
+     * Gets local grid node. Instance of local node is provided by underlying {@link DiscoverySpi}
      * implementation used.
      *
      * @return Local grid node.
-     * @see org.apache.ignite.spi.discovery.DiscoverySpi
+     * @see DiscoverySpi
      */
     public ClusterNode localNode();
 


[36/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' 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/3061522f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3061522f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3061522f

Branch: refs/heads/ignite-674
Commit: 3061522f91779a45ecaba336abd25a2e3904cd3e
Parents: d214c21 b78dbff
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 16:35:04 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 16:35:04 2015 +0300

----------------------------------------------------------------------
 .gitignore                     |   2 +-
 scripts/git-apply-patch.sh     |  88 ++++++++++++++++++++++++
 scripts/git-format-patch.sh    |  84 +++++++++++++++++++++++
 scripts/git-patch-functions.sh | 132 ++++++++++++++++++++++++++++++++++++
 scripts/git-patch-prop.sh      |  28 ++++++++
 5 files changed, 333 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[20/50] [abbrv] incubator-ignite git commit: ignite-gg-10002 - events

Posted by ag...@apache.org.
ignite-gg-10002 - events


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

Branch: refs/heads/ignite-674
Commit: 5cabdf25e8c8e20015020b399621c3fd9b75212e
Parents: 162bdac
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Apr 2 17:10:21 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Apr 2 17:10:21 2015 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  | 80 ++++++++++++++++++--
 1 file changed, 72 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cabdf25/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index a0718e5..959d1cc 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -23,6 +23,7 @@ import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.managers.eventstorage.*;
+import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.processors.query.h2.*;
 import org.apache.ignite.internal.processors.query.h2.twostep.messages.*;
@@ -182,7 +183,9 @@ public class GridMapQueryExecutor implements GridMessageListener {
             throw new IgniteException(e);
         }
 
-        QueryResults qr = new QueryResults(req.requestId(), qrys.size());
+        GridCacheContext<?,?> cctx = ctx.cache().internalCache(req.space()).context();
+
+        QueryResults qr = new QueryResults(req.requestId(), qrys.size(), cctx);
 
         if (nodeRess.put(req.requestId(), qr) != null)
             throw new IllegalStateException();
@@ -207,19 +210,19 @@ public class GridMapQueryExecutor implements GridMessageListener {
                         "SQL query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
                         CacheQueryType.SQL,
-                        null,
+                        cctx.namex(),
                         null,
                         qry.query(),
                         null,
                         null,
                         qry.parameters(),
-                        null,
+                        node.id(),
                         null));
                 }
 
                 assert rs instanceof JdbcResultSet : rs.getClass();
 
-                qr.addResult(i, rs);
+                qr.addResult(i, qry, node.id(), rs);
 
                 if (qr.canceled) {
                     qr.result(i).close();
@@ -393,14 +396,19 @@ public class GridMapQueryExecutor implements GridMessageListener {
         private final AtomicReferenceArray<QueryResult> results;
 
         /** */
+        private final GridCacheContext<?,?> cctx;
+
+        /** */
         private volatile boolean canceled;
 
         /**
          * @param qryReqId Query request ID.
          * @param qrys Number of queries.
+         * @param cctx Cache context.
          */
-        private QueryResults(long qryReqId, int qrys) {
+        private QueryResults(long qryReqId, int qrys, GridCacheContext<?,?> cctx) {
             this.qryReqId = qryReqId;
+            this.cctx = cctx;
 
             results = new AtomicReferenceArray<>(qrys);
         }
@@ -415,10 +423,12 @@ public class GridMapQueryExecutor implements GridMessageListener {
 
         /**
          * @param qry Query result index.
+         * @param q Query object.
+         * @param qrySrcNodeId Query source node.
          * @param rs Result set.
          */
-        void addResult(int qry, ResultSet rs) {
-            if (!results.compareAndSet(qry, null, new QueryResult(rs)))
+        void addResult(int qry, GridCacheSqlQuery q, UUID qrySrcNodeId, ResultSet rs) {
+            if (!results.compareAndSet(qry, null, new QueryResult(rs, cctx, qrySrcNodeId, q)))
                 throw new IllegalStateException();
         }
 
@@ -462,6 +472,15 @@ public class GridMapQueryExecutor implements GridMessageListener {
         private final ResultSet rs;
 
         /** */
+        private final GridCacheContext<?,?> cctx;
+
+        /** */
+        private final GridCacheSqlQuery qry;
+
+        /** */
+        private final UUID qrySrcNodeId;
+
+        /** */
         private int page;
 
         /** */
@@ -472,9 +491,15 @@ public class GridMapQueryExecutor implements GridMessageListener {
 
         /**
          * @param rs Result set.
+         * @param cctx Cache context.
+         * @param qrySrcNodeId Query source node.
+         * @param qry Query.
          */
-        private QueryResult(ResultSet rs) {
+        private QueryResult(ResultSet rs, GridCacheContext<?,?> cctx, UUID qrySrcNodeId, GridCacheSqlQuery qry) {
             this.rs = rs;
+            this.cctx = cctx;
+            this.qry = qry;
+            this.qrySrcNodeId = qrySrcNodeId;
 
             try {
                 res = (ResultInterface)RESULT_FIELD.get(rs);
@@ -495,18 +520,57 @@ public class GridMapQueryExecutor implements GridMessageListener {
             if (closed)
                 return true;
 
+            boolean readEvt = cctx.gridEvents().isRecordable(EVT_CACHE_QUERY_OBJECT_READ);
+
             page++;
 
             for (int i = 0 ; i < pageSize; i++) {
                 if (!res.next())
                     return true;
 
+                Value[] row = res.currentRow();
+
+                assert row != null;
+
+                if (readEvt) {
+                    cctx.gridEvents().record(new CacheQueryReadEvent<>(
+                        cctx.localNode(),
+                        "SQL fields query result set row read.",
+                        EVT_CACHE_QUERY_OBJECT_READ,
+                        CacheQueryType.SQL,
+                        cctx.namex(),
+                        null,
+                        qry.query(),
+                        null,
+                        null,
+                        qry.parameters(),
+                        qrySrcNodeId,
+                        null,
+                        null,
+                        null,
+                        null,
+                        row(row)));
+                }
+
                 rows.add(res.currentRow());
             }
 
             return false;
         }
 
+        /**
+         * @param row Values array row.
+         * @return Objects list row.
+         */
+        private List<?> row(Value[] row) {
+            List<Object> res = new ArrayList<>(row.length);
+
+            for (Value v : row)
+                res.add(v.getObject());
+
+            return res;
+        }
+
         /** {@inheritDoc} */
         @Override public synchronized void close() {
             if (closed)


[34/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' 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/b78dbfff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b78dbfff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b78dbfff

Branch: refs/heads/ignite-674
Commit: b78dbfff1c61165288ff46b8cf1407f83eba2089
Parents: 82a93c5 d2d6def
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 16:32:20 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 16:32:20 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java | 7 +++++++
 .../ignite/spi/communication/tcp/TcpCommunicationSpi.java     | 6 +++---
 .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java  | 7 -------
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[32/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 moved 'isNodeStopping' to SpiAdapter

Posted by ag...@apache.org.
# ignite-sprint-3 moved 'isNodeStopping' to SpiAdapter


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

Branch: refs/heads/ignite-674
Commit: d2d6def52dd469869592ee2fd7b9df2a83ba4812
Parents: 3af6914
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 16:14:24 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 16:14:24 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java | 7 +++++++
 .../ignite/spi/communication/tcp/TcpCommunicationSpi.java     | 6 +++---
 .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java  | 7 -------
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2d6def5/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index bb66872..2bd262c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -357,6 +357,13 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
     }
 
     /**
+     * @return {@code True} if node is stopping.
+     */
+    protected final boolean isNodeStopping() {
+        return spiCtx.isStopping();
+    }
+
+    /**
      * @return {@code true} if this check is optional.
      */
     private boolean checkOptional() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2d6def5/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 0ab0cf2..613ff64 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -257,7 +257,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         clients.remove(id, rmv)) {
                         rmv.forceClose();
 
-                        if (!getSpiContext().isStopping()) {
+                        if (!isNodeStopping()) {
                             GridNioRecoveryDescriptor recoveryData = ses.recoveryDescriptor();
 
                             if (recoveryData != null) {
@@ -1460,7 +1460,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
     /** {@inheritDoc} */
     @Override public void spiStop() throws IgniteSpiException {
-        assert getSpiContext().isStopping();
+        assert isNodeStopping();
 
         unregisterMBean();
 
@@ -1619,7 +1619,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
             GridCommunicationClient client = clients.get(nodeId);
 
             if (client == null) {
-                if (getSpiContext().isStopping())
+                if (isNodeStopping())
                     throw new IgniteSpiException("Node is stopping.");
 
                 // Do not allow concurrent connects.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2d6def5/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index d5c05f7..cd18370 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1060,13 +1060,6 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
     }
 
     /**
-     * @return {@code True} if node is stopping.
-     */
-    private boolean isNodeStopping() {
-        return super.getSpiContext().isStopping();
-    }
-
-    /**
      * @throws IgniteSpiException If any error occurs.
      * @return {@code true} if IP finder contains local address.
      */


[33/50] [abbrv] incubator-ignite git commit: # patch-scripts: Implemented (format and apply ).

Posted by ag...@apache.org.
# patch-scripts: Implemented (format and apply ).


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

Branch: refs/heads/ignite-674
Commit: 82a93c5cdb0d8cad85af5e8de57e9fde0c1a1a97
Parents: 3af6914
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 16:30:44 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 16:30:44 2015 +0300

----------------------------------------------------------------------
 .gitignore                     |   2 +-
 scripts/git-apply-patch.sh     |  88 ++++++++++++++++++++++++
 scripts/git-format-patch.sh    |  84 +++++++++++++++++++++++
 scripts/git-patch-functions.sh | 132 ++++++++++++++++++++++++++++++++++++
 scripts/git-patch-prop.sh      |  28 ++++++++
 5 files changed, 333 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82a93c5c/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index cd1e894..296e130 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,6 @@ xcuserdata/
 atlassian-ide-plugin.xml
 *.iml
 target
-target/*
 /libs/
 pom-installed.xml
+git-patch-prop-local.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82a93c5c/scripts/git-apply-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh
new file mode 100644
index 0000000..448421b
--- /dev/null
+++ b/scripts/git-apply-patch.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+#
+# 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.
+#
+
+#
+# Git patch-file applyer.
+#
+echo 'Usage: scripts/git-apply-patch.sh <ignite-task> [-ih|--ignitehome <path>] [-idb|--ignitedefbranch <branch-name>] [-ph|--patchhome <path>]'
+echo "It should be called from IGNITE_HOME directory."
+echo "Patch will be applied to DEFAULT_BRANCH from PATCHES_HOME."
+echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set your own local properties (to rewrite settings at git-patch-prop-local.sh). "
+echo
+
+#
+# Ignite task.
+#
+IGNITE_TASK=$1
+
+#
+# Read command line params.
+#
+while [[ $# > 1 ]]
+do
+    key="$1"
+
+    case $key in
+        -ih|--ignitehome)
+        IGNITE_HOME="$2"
+        shift
+        ;;
+        -idb|--ignitedefbranch)
+        IGNITE_DEFAULT_BRANCH="$2"
+        shift
+        ;;
+        -ph|--patchhome)
+        PATCHES_HOME="$2"
+        shift
+        ;;
+        *)
+                # unknown option
+        ;;
+    esac
+    shift
+done
+
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+echo "IGNITE_HOME    : ${IGNITE_HOME}"
+echo "Master branch  : ${IGNITE_DEFAULT_BRANCH}"
+echo "Ignite task    : ${IGNITE_TASK}"
+echo
+echo "PATCHES_HOME   : ${PATCHES_HOME}"
+echo
+
+#
+# Main script logic.
+#
+
+currentAndDefaultBranchesShouldBeEqual ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH}
+
+requireCleanWorkTree ${IGNITE_HOME}
+
+IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}_ignite.patch
+
+applyPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_PATCH_FILE}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82a93c5c/scripts/git-format-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-format-patch.sh b/scripts/git-format-patch.sh
new file mode 100644
index 0000000..575a7bb
--- /dev/null
+++ b/scripts/git-format-patch.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+#
+# 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.
+#
+
+#
+# Git patch-file maker.
+#
+echo 'Usage: scripts/git-format-patch.sh [-ih|--ignitehome <path>] [-idb|--ignitedefbranch <branch-name>] [-ph|--patchhome <path>]'
+echo "It should be called from IGNITE_HOME directory."
+echo "Patch will be created at PATCHES_HOME between Master branch (IGNITE_DEFAULT_BRANCH) and Current branch."
+echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set your own local properties (to rewrite settings at git-patch-prop-local.sh). "
+echo
+
+#
+# Read command line params.
+#
+while [[ $# > 1 ]]
+do
+    key="$1"
+
+    case $key in
+        -ih|--ignitehome)
+        IGNITE_HOME="$2"
+        shift
+        ;;
+        -idb|--ignitedefbranch)
+        IGNITE_DEFAULT_BRANCH="$2"
+        shift
+        ;;
+        -ph|--patchhome)
+        PATCHES_HOME="$2"
+        shift
+        ;;
+        *)
+                # unknown option
+        ;;
+    esac
+    shift
+done
+
+#
+# Init home and import properties and functions.
+#
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+IGNITE_CURRENT_BRANCH=$( determineCurrentBranch ${IGNITE_HOME} )
+
+echo "IGNITE_HOME    : ${IGNITE_HOME}"
+echo "Master branch  : ${IGNITE_DEFAULT_BRANCH}"
+echo "Current branch : ${IGNITE_CURRENT_BRANCH}"
+echo
+echo "PATCHES_HOME   : ${PATCHES_HOME}"
+echo
+
+#
+# Main script logic.
+#
+
+requireCleanWorkTree ${IGNITE_HOME}
+
+formatPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_CURRENT_BRANCH} _ignite.patch
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82a93c5c/scripts/git-patch-functions.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-functions.sh b/scripts/git-patch-functions.sh
new file mode 100644
index 0000000..ab9bec3
--- /dev/null
+++ b/scripts/git-patch-functions.sh
@@ -0,0 +1,132 @@
+#!/bin/bash
+#
+# 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.
+#
+
+#
+# Git patch functions.
+#
+
+#
+# Define functions.
+#
+formatPatch () {
+    GIT_HOME=$1
+    DEFAULT_BRANCH=$2
+    PATCHED_BRANCH=$3
+    PATCH_SUFFIX=$4
+
+    cd ${GIT_HOME}
+
+    git checkout ${DEFAULT_BRANCH}
+    git checkout -b tmppatch
+    
+    git merge --no-edit ${PATCHED_BRANCH}
+#    Or we can 'squashe' merge to make only one commit.
+#    git merge --squash ${PATCHED_BRANCH}
+#    git commit -a -m "# PATCHED_BRANCH"
+
+    PATCH_FILE=${PATCHES_HOME}'/'${DEFAULT_BRANCH}_${PATCHED_BRANCH}${PATCH_SUFFIX}
+
+    git format-patch ${DEFAULT_BRANCH}  --stdout > ${PATCH_FILE}
+    echo "Patch file created."
+
+    git checkout ${PATCHED_BRANCH}
+    
+    git branch -D tmppatch # Delete tmp branch.
+    
+    echo 
+    echo "Patch created: ${PATCH_FILE}"
+}
+
+determineCurrentBranch () {
+    GIT_HOME=$1
+    
+    cd ${GIT_HOME}
+    
+    CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
+    
+    echo "$CURRENT_BRANCH"
+}
+
+requireCleanWorkTree () {
+    cd $1 # At git home.
+
+    # Update the index
+    git update-index -q --ignore-submodules --refresh
+    err=0
+
+    # Disallow unstaged changes in the working tree
+    if ! git diff-files --quiet --ignore-submodules --
+    then
+        echo $0", ERROR:"
+        echo >&2 "You have unstaged changes."
+        git diff-files --name-status -r --ignore-submodules -- >&2
+        err=1
+    fi
+
+    # Disallow uncommitted changes in the index
+    if ! git diff-index --cached --quiet HEAD --ignore-submodules --
+    then
+        echo $0", ERROR:"
+        echo >&2 "Your index contains uncommitted changes."
+        git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
+        err=1
+    fi
+
+    if [ $err = 1 ]
+    then
+        echo >&2 "Please commit or stash them."
+        exit 1
+    fi
+}
+
+applyPatch () {
+    GIT_HOME=$1
+    DEFAULT_BRANCH=$2
+    PATCH_FILE=$3
+
+    cd ${GIT_HOME}
+    
+    if [ ! -f ${PATCH_FILE} ]
+    then
+        echo $0", ERROR:"
+        echo "Expected patch file not found: $PATCH_FILE."
+        
+        exit 1
+    fi
+
+    echo "Patch $PATCH_FILE will be applied to $DEFAULT_BRANCH branch."
+#    git apply ${PATCH_FILE}
+    git am ${PATCH_FILE}
+}
+
+currentAndDefaultBranchesShouldBeEqual () {
+    GIT_HOME=$1
+    DEFAULT_BRANCH=$2
+
+    cd ${GIT_HOME}
+
+    CURRENT_BRANCH=$( determineCurrentBranch ${GIT_HOME} )
+    
+    if [ "$CURRENT_BRANCH" != "$DEFAULT_BRANCH" ]
+    then 
+        echo $0", ERROR:"
+        echo "You are not on an expected branch. Your current branch at $GIT_HOME is $CURRENT_BRANCH, should be $DEFAULT_BRANCH."
+        
+        exit 1
+    fi
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82a93c5c/scripts/git-patch-prop.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-prop.sh b/scripts/git-patch-prop.sh
new file mode 100644
index 0000000..7eb3639
--- /dev/null
+++ b/scripts/git-patch-prop.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# 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.
+#
+
+#
+# Git patch-file maker/applyer properties.
+#
+if [ "${IGNITE_DEFAULT_BRANCH}" = "" ]
+    then IGNITE_DEFAULT_BRANCH='sprint-2'
+fi
+
+if [ "${PATCHES_HOME}" = "" ]
+    then PATCHES_HOME=${GG_HOME}
+fi
\ No newline at end of file


[40/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 minor

Posted by ag...@apache.org.
# ignite-sprint-3 minor


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

Branch: refs/heads/ignite-674
Commit: a28bc74ce45c50730f0ccb1511f120ceaa34b74f
Parents: 3061522
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 17:19:18 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 17:19:18 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheMapEntry.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a28bc74c/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 01c6135..5924129 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
@@ -3993,14 +3993,14 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         assert cctx.deferredDelete();
 
         if (deleted) {
-            assert !deletedUnlocked();
+            assert !deletedUnlocked() : this;
 
             flags |= IS_DELETED_MASK;
 
             cctx.decrementPublicSize(this);
         }
         else {
-            assert deletedUnlocked();
+            assert deletedUnlocked() : this;
 
             flags &= ~IS_DELETED_MASK;
 


[21/50] [abbrv] incubator-ignite git commit: Merge branch 'ignite-gg-10002' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-3

Posted by ag...@apache.org.
Merge branch 'ignite-gg-10002' 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/0180d180
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0180d180
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0180d180

Branch: refs/heads/ignite-674
Commit: 0180d1803d20bfd52687a5f279b37688d616a0f8
Parents: 7e86251 5cabdf2
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Apr 2 22:52:12 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Apr 2 22:52:12 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/CacheTypeMetadata.java  |   4 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   8 ++
 .../IgniteCacheObjectProcessorImpl.java         |   5 +
 .../processors/query/GridQueryProcessor.java    | 143 +++++++++----------
 .../messages/GridQueryNextPageResponse.java     |  34 ++---
 .../query/h2/twostep/GridMapQueryExecutor.java  |  86 +++++++++--
 .../query/h2/twostep/GridResultPage.java        |   9 +-
 7 files changed, 185 insertions(+), 104 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0180d180/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0180d180/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------


[31/50] [abbrv] incubator-ignite git commit: # ignite-sprint-3 fixed test

Posted by ag...@apache.org.
# ignite-sprint-3 fixed test


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

Branch: refs/heads/ignite-674
Commit: 3af69146f37bf6938b408da3584d722088d2dc4a
Parents: 09a3a82
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 14:59:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 14:59:02 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/near/GridCacheNearReadersSelfTest.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3af69146/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 59378bb..74c38db 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
@@ -479,7 +479,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
         assertNull(dhtPeek(1, key2));
         assertNull(dhtPeek(2, key2));
 
-        assertNull(near(0).peekEx(key2));
+        assertTrue(near(0).peekEx(key2) == null || near(0).peekEx(key2).deleted());
         assertNull(near(1).peekEx(key2));
         assertNull(near(2).peekEx(key2));
 


[08/50] [abbrv] incubator-ignite git commit: Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002

Posted by ag...@apache.org.
Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002


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

Branch: refs/heads/ignite-674
Commit: 9a6296279d03732f97defa11c591e075c1cc0e71
Parents: f8d5d44 efd98ba
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Apr 1 18:16:22 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Apr 1 18:16:22 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                |  19 ++-
 examples/schema-import/pom.xml                  |  10 +-
 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 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |   2 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |   9 +-
 .../configuration/FileSystemConfiguration.java  |   6 +
 .../apache/ignite/internal/IgniteKernal.java    |   5 +-
 .../cache/DynamicCacheDescriptor.java           |   2 +-
 .../processors/cache/GridCacheAdapter.java      |   4 +-
 .../processors/cache/GridCacheProcessor.java    |  66 +++++------
 .../continuous/CacheContinuousQueryManager.java |  28 +++++
 .../processors/igfs/IgfsDataManager.java        |  11 +-
 .../processors/igfs/IgfsFileAffinityRange.java  |  23 +---
 .../processors/igfs/IgfsHelperImpl.java         |   3 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   9 +-
 .../ignite/startup/BasicWarmupClosure.java      |   2 +-
 ...IgniteCacheJdbcBlobStoreNodeRestartTest.java |  52 +++++++++
 ...IgniteCacheStoreNodeRestartAbstractTest.java | 116 +++++++++++++++++++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 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 +-
 modules/urideploy/pom.xml                       |   6 +-
 modules/visor-console/pom.xml                   |   8 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   8 +-
 modules/yardstick/pom.xml                       |   6 +-
 pom.xml                                         |  56 ++++-----
 49 files changed, 440 insertions(+), 192 deletions(-)
----------------------------------------------------------------------



[30/50] [abbrv] incubator-ignite git commit: ignite-658

Posted by ag...@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-674
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>


[29/50] [abbrv] 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 ag...@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-674
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(+)
----------------------------------------------------------------------



[02/50] [abbrv] incubator-ignite git commit: ignite-645 Remove GridCachePeekMode

Posted by ag...@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-674
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;


[15/50] [abbrv] incubator-ignite git commit: # ignite-670 removed defaultTtl from configuration

Posted by ag...@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-674
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))


[12/50] [abbrv] incubator-ignite git commit: # ignite-645

Posted by ag...@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-674
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,


[11/50] [abbrv] incubator-ignite git commit: Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002

Posted by ag...@apache.org.
Merge branches 'ignite-gg-10002' and 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10002


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

Branch: refs/heads/ignite-674
Commit: aabe5a9c37421910bdb075b4289e21f8191219b9
Parents: 9a62962 ed6632a
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Apr 2 09:10:31 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Apr 2 09:10:31 2015 +0300

----------------------------------------------------------------------
 .../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 +-
 .../IgniteCacheObjectProcessorImpl.java         | 172 ++++++----
 .../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 +++
 .../junits/common/GridCommonAbstractTest.java   |   2 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   9 +
 .../scala/org/apache/ignite/visor/visor.scala   |   2 +-
 18 files changed, 788 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aabe5a9c/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------


[07/50] [abbrv] incubator-ignite git commit: ignite-gg-10002 - removed unneeded marshalling-unmarshalling for local node

Posted by ag...@apache.org.
ignite-gg-10002 - removed unneeded marshalling-unmarshalling for local node


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

Branch: refs/heads/ignite-674
Commit: f8d5d4457dae69966d94d5e43ba030d6ef97b435
Parents: e78ce56
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Apr 1 18:15:11 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Apr 1 18:15:11 2015 +0300

----------------------------------------------------------------------
 .../messages/GridQueryNextPageResponse.java     | 32 ++++++++------------
 .../query/h2/twostep/GridMapQueryExecutor.java  |  6 ++--
 .../query/h2/twostep/GridResultPage.java        |  9 +++++-
 3 files changed, 25 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
index e798051..22f9cb4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
@@ -26,7 +26,7 @@ import java.nio.*;
 /**
  * Next page response.
  */
-public class GridQueryNextPageResponse implements Externalizable, Message {
+public class GridQueryNextPageResponse implements Message {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -45,6 +45,9 @@ public class GridQueryNextPageResponse implements Externalizable, Message {
     /** */
     private byte[] rows;
 
+    /** */
+    private transient Object plainRows;
+
     /**
      * For {@link Externalizable}.
      */
@@ -58,16 +61,18 @@ public class GridQueryNextPageResponse implements Externalizable, Message {
      * @param page Page.
      * @param allRows All rows count.
      * @param rows Rows.
+     * @param plainRows Not marshalled rows for local node.
      */
     public GridQueryNextPageResponse(long qryReqId, int qry, int page, int allRows,
-        byte[] rows) {
-        assert rows != null;
+        byte[] rows, Object plainRows) {
+        assert rows != null ^ plainRows != null;
 
         this.qryReqId = qryReqId;
         this.qry = qry;
         this.page = page;
         this.allRows = allRows;
         this.rows = rows;
+        this.plainRows = plainRows;
     }
 
     /**
@@ -105,22 +110,11 @@ public class GridQueryNextPageResponse implements Externalizable, Message {
         return rows;
     }
 
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeLong(qryReqId);
-        out.writeInt(qry);
-        out.writeInt(page);
-        out.writeInt(allRows);
-        U.writeByteArray(out, rows);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        qryReqId = in.readLong();
-        qry = in.readInt();
-        page = in.readInt();
-        allRows = in.readInt();
-        rows = U.readByteArray(in);
+    /**
+     * @return Plain rows.
+     */
+    public Object plainRows() {
+        return plainRows;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 2f54943..a0718e5 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -309,10 +309,12 @@ public class GridMapQueryExecutor implements GridMessageListener {
         }
 
         try {
+            boolean loc = node.isLocal();
+
             GridQueryNextPageResponse msg = new GridQueryNextPageResponse(qr.qryReqId, qry, page,
-                page == 0 ? res.rowCount : -1, marshallRows(rows));
+                page == 0 ? res.rowCount : -1, loc ? null : marshallRows(rows), loc ? rows : null);
 
-            if (node.isLocal())
+            if (loc)
                 h2.reduceQueryExecutor().onMessage(ctx.localNodeId(), msg);
             else
                 ctx.io().send(node, GridTopic.TOPIC_QUERY, msg, GridIoPolicy.PUBLIC_POOL);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java
index e31829d..5f58b95 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java
@@ -44,6 +44,7 @@ public class GridResultPage {
      * @param res Response.
      * @param last If this is the globally last page.
      */
+    @SuppressWarnings("unchecked")
     public GridResultPage(UUID src, GridQueryNextPageResponse res, boolean last) {
         assert src != null;
 
@@ -55,7 +56,13 @@ public class GridResultPage {
             assert res == null : "The last page must be dummy.";
 
         // res == null means that it is a terminating dummy page for the given source node ID.
-        rows = res == null ? Collections.<Value[]>emptySet() : GridMapQueryExecutor.unmarshallRows(res.rows());
+        if (res != null) {
+            Object plainRows = res.plainRows();
+
+            rows = plainRows != null ? (Collection<Value[]>)plainRows : GridMapQueryExecutor.unmarshallRows(res.rows());
+        }
+        else
+            rows = Collections.emptySet();
     }
 
     /**


[22/50] [abbrv] incubator-ignite git commit: # Add GridCachePartitionNotLoadedEventSelfTest to suite.

Posted by ag...@apache.org.
# Add GridCachePartitionNotLoadedEventSelfTest to 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/b10fdc74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b10fdc74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b10fdc74

Branch: refs/heads/ignite-674
Commit: b10fdc74a39a1fee746e177909e72c1148f76557
Parents: 0180d18
Author: sevdokimov <se...@jetbrains.com>
Authored: Thu Apr 2 23:38:25 2015 +0300
Committer: sevdokimov <se...@jetbrains.com>
Committed: Thu Apr 2 23:39:03 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b10fdc74/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index a4553c4..d5ae2e6 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -219,6 +219,7 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheDhtPreloadDelayedSelfTest.class));
         suite.addTest(new TestSuite(GridPartitionedBackupLoadSelfTest.class));
         suite.addTest(new TestSuite(GridCachePartitionedLoadCacheSelfTest.class));
+        suite.addTest(new TestSuite(GridCachePartitionNotLoadedEventSelfTest.class));
         suite.addTest(new TestSuite(GridCacheDhtEvictionsDisabledSelfTest.class));
         suite.addTest(new TestSuite(GridCacheNearEvictionEventSelfTest.class));
         suite.addTest(new TestSuite(GridCacheAtomicNearEvictionEventSelfTest.class));


[39/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' 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/015420fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/015420fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/015420fd

Branch: refs/heads/ignite-674
Commit: 015420fd166bb1b0450457c39b43ec62583cd201
Parents: c280901 e100341
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 17:11:44 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 17:11:44 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/plugin/PluginContext.java   | 9 +++++----
 .../GridCacheAtomicInvalidPartitionHandlingSelfTest.java    | 5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[04/50] [abbrv] incubator-ignite git commit: ignite-gg-10002 - fixed

Posted by ag...@apache.org.
ignite-gg-10002 - fixed


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

Branch: refs/heads/ignite-674
Commit: e78ce56aebcb83d43b25ae96360d586d72d0eaf5
Parents: c9b3f21
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Apr 1 16:29:30 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Apr 1 16:29:30 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/CacheTypeMetadata.java  |   4 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   8 ++
 .../IgniteCacheObjectProcessorImpl.java         |   6 +-
 .../processors/query/GridQueryProcessor.java    | 143 ++++++++++---------
 4 files changed, 87 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e78ce56a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index db088e6..20129b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -98,9 +98,9 @@ public class CacheTypeMetadata implements Serializable {
 
         dbTbl = src.getDatabaseTable();
 
-        keyType = getKeyType();
+        keyType = src.getKeyType();
 
-        valType = getValueType();
+        valType = src.getValueType();
 
         keyFields = new ArrayList<>(src.getKeyFields());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e78ce56a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
index 42586d2..1f1f601 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
@@ -75,6 +75,14 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
     public boolean isPortableObject(Object obj);
 
     /**
+     * Checks whether given class is portable.
+     *
+     * @param cls Class.
+     * @return {@code true} If the class was registered as portable.
+     */
+    public boolean isPortableClass(Class<?> cls);
+
+    /**
      * @param obj Portable object to get field from.
      * @param fieldName Field name.
      * @return Field value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e78ce56a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index c0be7c9..53c3ea8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -26,7 +26,6 @@ import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.query.*;
 import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
@@ -294,6 +293,11 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isPortableClass(Class<?> cls) {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public int typeId(Object obj) {
         return 0;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e78ce56a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 2e5a7a0..4e30f41 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -70,9 +70,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     /** */
     private final GridQueryIndexing idx;
 
-    /** Portable ID to name mapping. */
-    private final Map<Integer, String> portableIds = new ConcurrentHashMap8<>();
-
     /**
      * @param ctx Kernal context.
      */
@@ -113,24 +110,39 @@ public class GridQueryProcessor extends GridProcessorAdapter {
      * @param ccfg Cache configuration.
      */
     public void initializeCache(CacheConfiguration<?, ?> ccfg) throws IgniteCheckedException {
-        Map<TypeName,CacheTypeMetadata> declaredTypes = new HashMap<>();
-
         idx.registerCache(ccfg);
 
         if (!F.isEmpty(ccfg.getTypeMetadata())) {
             for (CacheTypeMetadata meta : ccfg.getTypeMetadata()) {
-                declaredTypes.put(new TypeName(ccfg.getName(), meta.getValueType()), meta);
+                if (F.isEmpty(meta.getValueType()))
+                    throw new IgniteCheckedException("Value type is not set: " + meta);
+
+                TypeDescriptor desc = new TypeDescriptor(ccfg);
+
+                Class<?> valCls = U.classForName(meta.getValueType(), null);
+
+                desc.name(valCls != null ? typeName(valCls) : meta.getValueType());
+
+                desc.valueClass(valCls != null ? valCls : Object.class);
+                desc.keyClass(meta.getKeyType() == null ? Object.class : U.classForName(meta.getKeyType(), Object.class));
 
-                int valTypeId = ctx.cacheObjects().typeId(meta.getValueType());
+                TypeId typeId;
 
-                portableIds.put(valTypeId, meta.getValueType());
+                if (valCls == null || ctx.cacheObjects().isPortableClass(valCls)) {
+                    processPortableMeta(meta, desc);
 
-                TypeDescriptor desc = processPortableMeta(ccfg, meta);
+                    typeId = new TypeId(ccfg.getName(), ctx.cacheObjects().typeId(meta.getValueType()));
+                }
+                else {
+                    processClassMeta(meta, desc);
+
+                    typeId = new TypeId(ccfg.getName(), valCls);
+                }
 
                 desc.registered(idx.registerType(ccfg.getName(), desc));
 
                 typesByName.put(new TypeName(ccfg.getName(), desc.name()), desc);
-                types.put(new TypeId(ccfg.getName(), valTypeId), desc);
+                types.put(typeId, desc);
             }
         }
 
@@ -141,7 +153,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 Class<?> keyCls = clss[i];
                 Class<?> valCls = clss[i + 1];
 
-                TypeDescriptor desc = processKeyAndValueClasses(ccfg, keyCls, valCls, declaredTypes);
+                TypeDescriptor desc = processKeyAndValueClasses(ccfg, keyCls, valCls);
 
                 desc.registered(idx.registerType(ccfg.getName(), desc));
 
@@ -155,35 +167,23 @@ public class GridQueryProcessor extends GridProcessorAdapter {
      * @param ccfg Cache configuration.
      * @param keyCls Key class.
      * @param valCls Value class.
-     * @param declaredTypes Knows types.
      * @return Type descriptor.
      * @throws IgniteCheckedException If failed.
      */
-    private TypeDescriptor processKeyAndValueClasses(CacheConfiguration<?,?> ccfg, Class<?> keyCls, Class<?> valCls,
-        Map<TypeName,CacheTypeMetadata> declaredTypes)
+    private TypeDescriptor processKeyAndValueClasses(CacheConfiguration<?,?> ccfg, Class<?> keyCls, Class<?> valCls)
         throws IgniteCheckedException {
         TypeDescriptor d = new TypeDescriptor(ccfg);
 
         d.keyClass(keyCls);
         d.valueClass(valCls);
 
-        CacheTypeMetadata keyMeta = declaredTypes.get(new TypeName(ccfg.getName(), keyCls.getName()));
-
-        if (keyMeta == null)
-            processAnnotationsInClass(true, d.keyCls, d, null);
-        else
-            processClassMeta(true, d.keyCls, keyMeta, d);
+        processAnnotationsInClass(true, d.keyCls, d, null);
 
         String valTypeName = typeName(valCls);
 
         d.name(valTypeName);
 
-        CacheTypeMetadata typeMeta = declaredTypes.get(new TypeName(ccfg.getName(), valCls.getName()));
-
-        if (typeMeta == null)
-            processAnnotationsInClass(false, d.valCls, d, null);
-        else
-            processClassMeta(false, d.valCls, typeMeta, d);
+        processAnnotationsInClass(false, d.valCls, d, null);
 
         return d;
     }
@@ -397,16 +397,17 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         try {
             final Class<?> valCls = val.getClass();
 
-            int typeId = ctx.cacheObjects().typeId(val);
+            TypeId id;
 
             if (ctx.cacheObjects().isPortableObject(val)) {
-                String typeName = portableName(typeId);
+                int typeId = ctx.cacheObjects().typeId(val);
 
-                if (typeName == null)
-                    return;
+                id = new TypeId(space, typeId);
             }
+            else
+                id = new TypeId(space, valCls);
 
-            TypeDescriptor desc = types.get(new TypeId(space, typeId));
+            TypeDescriptor desc = types.get(id);
 
             if (desc == null || !desc.registered())
                 return;
@@ -707,16 +708,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Gets portable type name by portable ID.
-     *
-     * @param typeId Type ID.
-     * @return Name.
-     */
-    private String portableName(int typeId) {
-        return portableIds.get(typeId);
-    }
-
-    /**
      * @param space Space.
      * @param clause Clause.
      * @param resType Result type.
@@ -985,16 +976,20 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     /**
      * Processes declarative metadata for class.
      *
-     * @param key Key or value flag.
-     * @param cls Class to process.
      * @param meta Type metadata.
      * @param d Type descriptor.
      * @throws IgniteCheckedException If failed.
      */
-    static void processClassMeta(boolean key, Class<?> cls, CacheTypeMetadata meta, TypeDescriptor d)
+    static void processClassMeta(CacheTypeMetadata meta, TypeDescriptor d)
         throws IgniteCheckedException {
+        Class<?> keyCls = d.keyClass();
+        Class<?> valCls = d.valueClass();
+
+        assert keyCls != null;
+        assert valCls != null;
+
         for (Map.Entry<String, Class<?>> entry : meta.getAscendingFields().entrySet()) {
-            ClassProperty prop = buildClassProperty(key, cls, entry.getKey(), entry.getValue());
+            ClassProperty prop = buildClassProperty(keyCls, valCls, entry.getKey(), entry.getValue());
 
             d.addProperty(prop, false);
 
@@ -1006,7 +1001,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (Map.Entry<String, Class<?>> entry : meta.getDescendingFields().entrySet()) {
-            ClassProperty prop = buildClassProperty(key, cls, entry.getKey(), entry.getValue());
+            ClassProperty prop = buildClassProperty(keyCls, valCls, entry.getKey(), entry.getValue());
 
             d.addProperty(prop, false);
 
@@ -1018,7 +1013,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (String txtIdx : meta.getTextFields()) {
-            ClassProperty prop = buildClassProperty(key, cls, txtIdx, String.class);
+            ClassProperty prop = buildClassProperty(keyCls, valCls, txtIdx, String.class);
 
             d.addProperty(prop, false);
 
@@ -1036,7 +1031,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 int order = 0;
 
                 for (Map.Entry<String, IgniteBiTuple<Class<?>, Boolean>> idxField : idxFields.entrySet()) {
-                    ClassProperty prop = buildClassProperty(key, cls, idxField.getKey(), idxField.getValue().get1());
+                    ClassProperty prop = buildClassProperty(keyCls, valCls, idxField.getKey(), idxField.getValue().get1());
 
                     d.addProperty(prop, false);
 
@@ -1050,7 +1045,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (Map.Entry<String, Class<?>> entry : meta.getQueryFields().entrySet()) {
-            ClassProperty prop = buildClassProperty(key, cls, entry.getKey(), entry.getValue());
+            ClassProperty prop = buildClassProperty(keyCls, valCls, entry.getKey(), entry.getValue());
 
             d.addProperty(prop, false);
         }
@@ -1059,15 +1054,12 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     /**
      * Processes declarative metadata for portable object.
      *
-     * @param ccfg Cache configuration.
      * @param meta Declared metadata.
-     * @return Type descriptor.
+     * @param d Type descriptor.
      * @throws IgniteCheckedException If failed.
      */
-    private TypeDescriptor processPortableMeta(CacheConfiguration<?,?> ccfg, CacheTypeMetadata meta)
+    private void processPortableMeta(CacheTypeMetadata meta, TypeDescriptor d)
         throws IgniteCheckedException {
-        TypeDescriptor d = new TypeDescriptor(ccfg);
-
         for (Map.Entry<String, Class<?>> entry : meta.getAscendingFields().entrySet()) {
             PortableProperty prop = buildPortableProperty(entry.getKey(), entry.getValue());
 
@@ -1130,18 +1122,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             if (!d.props.containsKey(prop.name()))
                 d.addProperty(prop, false);
         }
-
-        if (F.isEmpty(meta.getValueType()))
-            throw new IgniteCheckedException("Value type is not set: " + meta);
-
-        Class<?> valCls = U.classForName(meta.getValueType(), null);
-
-        d.name(valCls != null ? typeName(valCls) : meta.getValueType());
-
-        d.valueClass(valCls != null ? valCls : Object.class);
-        d.keyClass(meta.getKeyType() == null ? Object.class : U.classForName(meta.getKeyType(), Object.class));
-
-        return d;
     }
 
     /**
@@ -1164,6 +1144,29 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * @param keyCls Key class.
+     * @param valCls Value class.
+     * @param pathStr Path string.
+     * @param resType Result type.
+     * @return Class property.
+     * @throws IgniteCheckedException If failed.
+     */
+    private static ClassProperty buildClassProperty(Class<?> keyCls, Class<?> valCls, String pathStr, Class<?> resType)
+        throws IgniteCheckedException {
+        ClassProperty res = buildClassProperty(true, keyCls, pathStr, resType);
+
+        if (res == null) // We check key before value consistently with PortableProperty.
+            res = buildClassProperty(false, valCls, pathStr, resType);
+
+        if (res == null)
+            throw new IgniteCheckedException("Failed to initialize property '" + pathStr + "' for " +
+                "key class '" + keyCls + "' and value class '" + valCls + "'. " +
+                "Make sure that one of these classes contains respective getter method or field.");
+
+        return res;
+    }
+
+    /**
      * @param key If this is a key property.
      * @param cls Source type class.
      * @param pathStr String representing path to the property. May contains dots '.' to identify nested fields.
@@ -1194,8 +1197,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     tmp = new ClassProperty(cls.getDeclaredField(prop), key);
                 }
                 catch (NoSuchFieldException ignored) {
-                    throw new IgniteCheckedException("Failed to find getter method or field for property named " +
-                        "'" + prop + "': " + cls.getName());
+                    return null;
                 }
             }
 
@@ -1207,9 +1209,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         if (!U.box(resType).isAssignableFrom(U.box(res.type())))
-            throw new IgniteCheckedException("Failed to create property for given path (actual property type is not assignable" +
-                " to declared type [path=" + pathStr + ", actualType=" + res.type().getName() +
-                ", declaredType=" + resType.getName() + ']');
+            return null;
 
         return res;
     }
@@ -1449,6 +1449,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 int isKeyProp0 = isKeyProp;
 
                 if (isKeyProp0 == 0) { // Key is allowed to be a non-portable object here.
+                    // We check key before value consistently with ClassProperty.
                     if (ctx.cacheObjects().isPortableObject(key) && ctx.cacheObjects().hasField(key, propName))
                         isKeyProp = isKeyProp0 = 1;
                     else if (ctx.cacheObjects().hasField(val, propName))


[46/50] [abbrv] incubator-ignite git commit: ignite-666: Exclude **/*.sql pattern from RAT exclude list

Posted by ag...@apache.org.
ignite-666: Exclude **/*.sql pattern from RAT exclude list


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

Branch: refs/heads/ignite-674
Commit: 580f0511771c414fc8e12937701f73946623b265
Parents: 5cc2d36
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:52:57 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:52:57 2015 +0300

----------------------------------------------------------------------
 examples/schema-import/bin/db-init.sql | 17 +++++++++++++++++
 parent/pom.xml                         |  1 -
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/580f0511/examples/schema-import/bin/db-init.sql
----------------------------------------------------------------------
diff --git a/examples/schema-import/bin/db-init.sql b/examples/schema-import/bin/db-init.sql
index 4568959..f02236a 100644
--- a/examples/schema-import/bin/db-init.sql
+++ b/examples/schema-import/bin/db-init.sql
@@ -1,3 +1,20 @@
+--
+--  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.
+--
+
 -- Script of database initialization for Schema Import Demo.
 drop table PERSON;
 create table PERSON(id integer not null, first_name varchar(50), last_name varchar(50), salary double not null, PRIMARY KEY(id));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/580f0511/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f475b85..8affeef 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -598,7 +598,6 @@
                                         <exclude>**/keystore/*.jks</exclude><!--bin-files-->
                                         <exclude>**/keystore/*.pem</exclude><!--auto generated files-->
                                         <exclude>**/keystore/*.pfx</exclude><!--bin-files-->
-                                        <exclude>**/*.sql</exclude><!--sql files -->
                                         <!--special excludes-->
                                         <exclude>DEVNOTES.txt</exclude>
                                         <exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->


[50/50] [abbrv] incubator-ignite git commit: Merge branch ignite-sprint-3 into ignite-674

Posted by ag...@apache.org.
Merge branch ignite-sprint-3 into ignite-674


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

Branch: refs/heads/ignite-674
Commit: 0e3e6d0961ca9568144a2831f25781f6920dfc7b
Parents: 68eacf8
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Apr 3 15:45:36 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Apr 3 15:45:36 2015 -0700

----------------------------------------------------------------------
 .../cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java       | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0e3e6d09/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
index 9aa89be..143caf8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java
@@ -58,7 +58,6 @@ public class IgniteCacheMultiTxLockSelfTest extends GridCommonAbstractTest {
         CacheConfiguration ccfg = new CacheConfiguration();
 
         ccfg.setName(CACHE_NAME);
-        ccfg.setDefaultTimeToLive(120000);
         ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
         ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
         ccfg.setBackups(2);


[18/50] [abbrv] incubator-ignite git commit: Merge branch 'ignite-sprint-3' into ignite-645

Posted by ag...@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-674
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
----------------------------------------------------------------------


[24/50] [abbrv] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-670' into ignite-sprint-3

Posted by ag...@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-674
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
----------------------------------------------------------------------


[49/50] [abbrv] incubator-ignite git commit: Merge branch ignite-sprint-3 into ignite-674

Posted by ag...@apache.org.
Merge branch ignite-sprint-3 into ignite-674


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

Branch: refs/heads/ignite-674
Commit: 68eacf8ed556ab3332abc0a955f1c040723b8334
Parents: ab01e7d 580f051
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Apr 3 15:25:21 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Apr 3 15:25:21 2015 -0700

----------------------------------------------------------------------
 .gitignore                                      |   2 +-
 examples/schema-import/bin/db-init.sql          |  17 +
 modules/core/pom.xml                            |  38 +-
 .../apache/ignite/cache/CacheTypeMetadata.java  |   4 +-
 .../configuration/CacheConfiguration.java       |  31 +-
 .../ignite/events/CacheQueryExecutedEvent.java  |  11 +-
 .../ignite/events/CacheQueryReadEvent.java      |  11 +-
 .../ignite/internal/GridCachePluginContext.java |   6 +
 .../cache/CacheEvictableEntryImpl.java          |  11 +-
 .../processors/cache/CacheProjection.java       |  36 --
 .../processors/cache/GridCacheAdapter.java      | 260 +------------
 .../processors/cache/GridCacheAttributes.java   |   8 -
 .../cache/GridCacheConcurrentMap.java           |  34 +-
 .../cache/GridCacheDeploymentManager.java       |   7 +-
 .../processors/cache/GridCacheEntryEx.java      |  55 +--
 .../processors/cache/GridCacheMapEntry.java     | 240 +-----------
 .../cache/GridCacheMapEntryFactory.java         |   2 -
 .../processors/cache/GridCachePeekMode.java     |  81 ----
 .../processors/cache/GridCacheProcessor.java    |  67 ++--
 .../cache/GridCacheProjectionImpl.java          |  11 -
 .../processors/cache/GridCacheProxyImpl.java    |  24 --
 .../processors/cache/GridCacheUtils.java        |  11 -
 .../distributed/GridDistributedCacheEntry.java  |   4 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |  25 +-
 .../distributed/dht/GridDhtCacheEntry.java      |   4 +-
 .../distributed/dht/GridNoStorageCacheMap.java  |  11 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  32 +-
 .../dht/atomic/GridDhtAtomicCacheEntry.java     |   4 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  35 +-
 .../colocated/GridDhtColocatedCacheEntry.java   |   4 +-
 .../colocated/GridDhtDetachedCacheEntry.java    |   5 +-
 .../distributed/near/GridNearCacheAdapter.java  |  75 +---
 .../distributed/near/GridNearCacheEntry.java    |   4 +-
 .../distributed/near/GridNearTxRemote.java      |  11 +-
 .../processors/cache/local/GridLocalCache.java  |   3 +-
 .../cache/local/GridLocalCacheEntry.java        |   4 +-
 .../local/atomic/GridLocalAtomicCache.java      |   3 +-
 .../cache/query/GridCacheQueryManager.java      |  18 +-
 .../continuous/CacheContinuousQueryHandler.java |   4 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   8 +
 .../IgniteCacheObjectProcessorImpl.java         |   5 +
 .../datastreamer/DataStreamerImpl.java          |  21 +-
 .../processors/plugin/CachePluginManager.java   |  51 ++-
 .../processors/query/GridQueryProcessor.java    | 147 ++++----
 .../messages/GridQueryNextPageResponse.java     |  34 +-
 .../processors/task/GridTaskProcessor.java      |   9 +-
 .../cache/VisorCacheDefaultConfiguration.java   |  21 --
 .../ignite/plugin/CachePluginContext.java       |  11 +
 .../ignite/plugin/CachePluginProvider.java      |   4 +-
 .../org/apache/ignite/plugin/PluginContext.java |   9 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   7 +
 .../communication/tcp/TcpCommunicationSpi.java  |   6 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   7 -
 .../resources/META-INF/classnames.properties    |   1 -
 ...idCacheConfigurationConsistencySelfTest.java |   3 -
 .../GridCachePreloadingEvictionsSelfTest.java   |   4 +-
 .../processors/cache/GridCacheTestEntryEx.java  |  40 +-
 ...GridCacheDhtEvictionNearReadersSelfTest.java |  14 +-
 .../dht/GridCacheDhtEvictionSelfTest.java       |  24 +-
 .../GridCacheDhtEvictionsDisabledSelfTest.java  |   8 +-
 .../dht/GridCacheDhtMappingSelfTest.java        |   2 +-
 .../distributed/dht/GridCacheDhtTestUtils.java  |   2 +-
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +
 .../near/GridCacheNearMultiNodeSelfTest.java    | 103 +++---
 .../near/GridCacheNearOneNodeSelfTest.java      |  33 +-
 .../near/GridCacheNearReadersSelfTest.java      | 154 ++++----
 .../GridCacheReplicatedPreloadSelfTest.java     |  11 +-
 ...ridCacheContinuousQueryAbstractSelfTest.java |   4 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |   3 +-
 .../processors/igfs/IgfsSizeSelfTest.java       |  46 +--
 .../loadtests/hashmap/GridHashMapLoadTest.java  |   2 +-
 .../junits/common/GridCommonAbstractTest.java   |  42 +++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |   3 +
 .../query/h2/twostep/GridMapQueryExecutor.java  |  88 ++++-
 .../query/h2/twostep/GridResultPage.java        |   9 +-
 .../cache/GridIndexingWithNoopSwapSelfTest.java |   2 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   8 +-
 .../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      |   4 +-
 parent/pom.xml                                  |   1 -
 scripts/git-apply-patch.sh                      |  94 +++++
 scripts/git-format-patch.sh                     |  87 +++++
 scripts/git-patch-functions.sh                  | 171 +++++++++
 scripts/git-patch-prop.sh                       |  24 ++
 101 files changed, 1983 insertions(+), 1435 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68eacf8e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68eacf8e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68eacf8e/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/68eacf8e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index e941d30,0de4653..a9026b0
--- 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,9 -18,9 +18,10 @@@
  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.cluster.*;
  import org.apache.ignite.internal.processors.affinity.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68eacf8e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68eacf8e/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------