You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/09/11 13:03:50 UTC

[1/2] ignite git commit: ignite-1028 (cherry picked from commit 395b320)

Repository: ignite
Updated Branches:
  refs/heads/ignite-1.4 f02fca6d7 -> 82ca43176


ignite-1028
(cherry picked from commit 395b320)


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

Branch: refs/heads/ignite-1.4
Commit: 70ad5ba7721e58f0ac18d3c76fd00b3854df4387
Parents: f02fca6
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 11 12:06:32 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 11 14:02:21 2015 +0300

----------------------------------------------------------------------
 .../internal/util/GridSpiCloseableIteratorWrapper.java       | 5 +++++
 .../processors/cache/GridCacheP2PUndeploySelfTest.java       | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/70ad5ba7/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpiCloseableIteratorWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpiCloseableIteratorWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpiCloseableIteratorWrapper.java
index 5c76cbd..afc574f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpiCloseableIteratorWrapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpiCloseableIteratorWrapper.java
@@ -54,4 +54,9 @@ public class GridSpiCloseableIteratorWrapper<T> extends GridCloseableIteratorAda
     @Override protected void onClose() throws IgniteCheckedException {
         iter.close();
     }
+
+    /** {@inheritDoc} */
+    @Override protected void onRemove() throws IgniteCheckedException {
+        iter.remove();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/70ad5ba7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
index ba52c2f..2c8c748 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
@@ -81,7 +81,11 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
 
         cfg.setMarshaller(new JdkMarshaller());
 
-        cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+        FileSwapSpaceSpi swap = new FileSwapSpaceSpi();
+
+        swap.setWriteBufferSize(1);
+
+        cfg.setSwapSpaceSpi(swap);
 
         CacheConfiguration repCacheCfg = defaultCacheConfiguration();
 
@@ -233,6 +237,8 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
 
             cache2.localEvict(ImmutableSet.of(2, 3, 4));
 
+            U.sleep(100); //Time to store entries to disk.
+
             long swapSize = size(cacheName, grid2);
 
             info("Swap size: " + swapSize);


[2/2] ignite git commit: ignite-1028 (cherry picked from commit e4d7ae0)

Posted by sb...@apache.org.
ignite-1028
(cherry picked from commit e4d7ae0)


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

Branch: refs/heads/ignite-1.4
Commit: 82ca43176610ff543102b049c26a9f79add098ef
Parents: 70ad5ba
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 11 13:51:22 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 11 14:02:31 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheP2PUndeploySelfTest.java     | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/82ca4317/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
index 2c8c748..92c5340 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.processors.cache.distributed.GridCacheModuloAffinityFunction;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -36,6 +37,7 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi;
+import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -201,7 +203,7 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
      * @param cacheName Cache name.
      * @throws Exception If failed.
      */
-    private void checkP2PUndeploy(String cacheName) throws Exception {
+    private void checkP2PUndeploy(final String cacheName) throws Exception {
         assert !F.isEmpty(cacheName);
 
         ClassLoader ldr = getExternalClassLoader();
@@ -210,7 +212,7 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
 
         try {
             Ignite ignite1 = startGrid(1);
-            IgniteKernal grid2 = (IgniteKernal)startGrid(2);
+            final IgniteKernal grid2 = (IgniteKernal)startGrid(2);
 
             IgniteCache<Integer, Object> cache1 = ignite1.cache(cacheName);
             IgniteCache<Integer, Object> cache2 = grid2.cache(cacheName);
@@ -237,20 +239,24 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
 
             cache2.localEvict(ImmutableSet.of(2, 3, 4));
 
-            U.sleep(100); //Time to store entries to disk.
-
-            long swapSize = size(cacheName, grid2);
-
-            info("Swap size: " + swapSize);
-
-            assert swapSize > 0;
+            //Wait until entries stored to disk.
+            GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                @Override public boolean apply() {
+                    try {
+                        return size(cacheName, grid2) > 0;
+                    }
+                    catch (IgniteCheckedException e) {
+                        throw new AssertionError(e);
+                    }
+                }
+            }, 5000);
 
             stopGrid(1);
 
             assert waitCacheEmpty(cache2, 10000);
 
             for (int i = 0; i < 3; i++) {
-                swapSize = size(cacheName, grid2);
+                long swapSize = size(cacheName, grid2);
 
                 if (swapSize > 0) {
                     if (i < 2) {