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/07/07 16:56:11 UTC

[1/7] incubator-ignite git commit: # minor format

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-901 89fb3951a -> e3dd33137


# minor format


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

Branch: refs/heads/ignite-901
Commit: f2aa6ab5a5e049e10bfec06142b3f734d0709996
Parents: b87f138
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jul 7 10:35:03 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jul 7 10:35:03 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheObjectImpl.java     |  1 -
 .../distributed/dht/GridPartitionedGetFuture.java      | 13 ++++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2aa6ab5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
index ad033a7..96603f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
@@ -77,7 +77,6 @@ public class CacheObjectImpl extends CacheObjectAdapter {
         catch (IgniteCheckedException e) {
             throw new IgniteException("Failed to unmarshall object.", e);
         }
-
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2aa6ab5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 2f41e63..79d5e75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -224,7 +224,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
      * @param res Result.
      */
     public void onResult(UUID nodeId, GridNearGetResponse res) {
-        for (IgniteInternalFuture<Map<K, V>> fut : futures())
+        for (IgniteInternalFuture<Map<K, V>> fut : futures()) {
             if (isMini(fut)) {
                 MiniFuture f = (MiniFuture)fut;
 
@@ -234,6 +234,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                     f.onResult(res);
                 }
             }
+        }
     }
 
     /** {@inheritDoc} */
@@ -702,8 +703,14 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                     }
                 });
             }
-            else
-                onDone(createResultMap(res.entries()));
+            else {
+                try {
+                    onDone(createResultMap(res.entries()));
+                }
+                catch (Exception e) {
+                    onDone(e);
+                }
+            }
         }
 
         /** {@inheritDoc} */


[6/7] incubator-ignite git commit: ignite-1070 Zombie entries in cache with SortedEvictionPolicy

Posted by sb...@apache.org.
ignite-1070 Zombie entries in cache with SortedEvictionPolicy


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

Branch: refs/heads/ignite-901
Commit: 9d0aa6f1244e13187b64dec81b8d33d94f3db2af
Parents: 44506c3
Author: agura <ag...@gridgain.com>
Authored: Tue Jul 7 14:49:13 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Tue Jul 7 14:49:13 2015 +0300

----------------------------------------------------------------------
 .../cache/eviction/fifo/FifoEvictionPolicy.java  |  5 -----
 .../cache/eviction/lru/LruEvictionPolicy.java    |  5 -----
 .../eviction/sorted/SortedEvictionPolicy.java    | 19 +++++--------------
 ...cheConcurrentEvictionConsistencySelfTest.java | 15 +++++++++++++--
 4 files changed, 18 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d0aa6f1/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
index 221bc39..1e06ffd 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
@@ -216,11 +216,6 @@ public class FifoEvictionPolicy<K, V> implements EvictionPolicy<K, V>, FifoEvict
                 // If node was unlinked by concurrent shrink() call, we must repeat the whole cycle.
                 else if (!entry.removeMeta(node))
                     return false;
-                else {
-                    memSize.add(-entry.size());
-
-                    return true;
-                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d0aa6f1/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
index 0be26c8..ba6f88a 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
@@ -200,11 +200,6 @@ public class LruEvictionPolicy<K, V> implements EvictionPolicy<K, V>, LruEvictio
                 // If node was unlinked by concurrent shrink() call, we must repeat the whole cycle.
                 else if (!entry.removeMeta(node))
                     return false;
-                else {
-                    memSize.add(-entry.size());
-
-                    return true;
-                }
             }
         }
         else if (queue.unlinkx(node)) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d0aa6f1/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
index b8b82fa..d99b3b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
@@ -224,21 +224,17 @@ public class SortedEvictionPolicy<K, V> implements EvictionPolicy<K, V>, SortedE
     private boolean touch(EvictableEntry<K, V> entry) {
         Holder<K, V> holder = entry.meta();
 
-        // Entry has not been add yet to backed queue..
+        // Entry has not been added yet to backed queue.
         if (holder == null) {
             while (true) {
                 holder = new Holder<>(entry, orderCnt.incrementAndGet());
 
-                set.add(holder);
+                if (entry.putMetaIfAbsent(holder) != null)
+                    return false; // Set has not been changed.
 
-                if (entry.putMetaIfAbsent(holder) != null) {
-                    // Was concurrently added, need to remove it from queue.
-                    removeHolder(holder);
+                set.add(holder);
 
-                    // Set has not been changed.
-                    return false;
-                }
-                else if (holder.order > 0) {
+                if (holder.order > 0) {
                     if (!entry.isCached()) {
                         // Was concurrently evicted, need to remove it from queue.
                         removeHolder(holder);
@@ -253,11 +249,6 @@ public class SortedEvictionPolicy<K, V> implements EvictionPolicy<K, V>, SortedE
                 // If holder was removed by concurrent shrink() call, we must repeat the whole cycle.
                 else if (!entry.removeMeta(holder))
                     return false;
-                else {
-                    memSize.add(-entry.size());
-
-                    return true;
-                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d0aa6f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java
index 921422e..91e9ecc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.cache.eviction.lru.*;
 import org.apache.ignite.cache.eviction.sorted.*;
 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.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -273,15 +274,25 @@ public class GridCacheConcurrentEvictionConsistencySelfTest extends GridCommonAb
             info("Test results [threadCnt=" + threadCnt + ", iterCnt=" + ITERATION_CNT + ", cacheSize=" + cache.size() +
                 ", internalQueueSize" + queue.size() + ", duration=" + (System.currentTimeMillis() - start) + ']');
 
+            boolean detached = false;
+
             for (Cache.Entry<Integer, Integer> e : queue) {
                 Integer rmv = cache.getAndRemove(e.getKey());
 
-                if (rmv == null)
-                    fail("Eviction policy contains key that is not present in cache: " + e);
+                CacheEvictableEntryImpl unwrapped = e.unwrap(CacheEvictableEntryImpl.class);
+
+                if (rmv == null && (unwrapped.meta() != null || unwrapped.isCached())) {
+                    U.warn(log, "Detached entry: " + e);
+
+                    detached = true;
+                }
                 else
                     info("Entry removed: " + rmv);
             }
 
+            if (detached)
+                fail("Eviction policy contains keys that are not present in cache");
+
             if (!(cache.localSize() == 0)) {
                 boolean zombies = false;
 


[4/7] incubator-ignite git commit: merge from ignite-882

Posted by sb...@apache.org.
merge from ignite-882


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

Branch: refs/heads/ignite-901
Commit: 9314a68e31f1b449665a26335868e39478ff2f98
Parents: 96c9695
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Jul 7 14:13:19 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Jul 7 14:13:19 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 26 ++++++++++++++++++++
 .../GridCachePartitionedNodeRestartTest.java    |  5 ----
 ...ePartitionedOptimisticTxNodeRestartTest.java |  2 +-
 .../GridCacheReplicatedFailoverSelfTest.java    |  5 ----
 .../GridCacheReplicatedNodeRestartSelfTest.java |  5 ----
 5 files changed, 27 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9314a68e/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 94a2290..f8fae34 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -2076,6 +2076,9 @@ class ServerImpl extends TcpDiscoveryImpl {
                                         boolean nextNew = (msg instanceof TcpDiscoveryNodeAddedMessage &&
                                             ((TcpDiscoveryNodeAddedMessage)msg).node().id().equals(nextId));
 
+                                        if (!nextNew)
+                                            nextNew = hasPendingAddMessage(nextId);
+
                                         if (!nextNew) {
                                             if (log.isDebugEnabled())
                                                 log.debug("Failed to restore ring because next node order received " +
@@ -2364,6 +2367,29 @@ class ServerImpl extends TcpDiscoveryImpl {
         }
 
         /**
+         * Checks whether pending messages queue contains unprocessed {@link TcpDiscoveryNodeAddedMessage} for
+         * the node with {@code nodeId}.
+         *
+         * @param nodeId Node ID.
+         * @return {@code true} if contains, {@code false} otherwise.
+         */
+        private boolean hasPendingAddMessage(UUID nodeId) {
+            if (pendingMsgs.msgs.isEmpty())
+                return false;
+
+            for (TcpDiscoveryAbstractMessage pendingMsg : pendingMsgs.msgs) {
+                if (pendingMsg instanceof TcpDiscoveryNodeAddedMessage) {
+                    TcpDiscoveryNodeAddedMessage addMsg = (TcpDiscoveryNodeAddedMessage)pendingMsg;
+
+                    if (addMsg.node().id().equals(nodeId) && addMsg.id().compareTo(pendingMsgs.discardId) > 0)
+                        return true;
+                }
+            }
+
+            return false;
+        }
+
+        /**
          * Processes join request message.
          *
          * @param msg Join request message.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9314a68e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
index 9529f9d..2096836 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
@@ -30,11 +30,6 @@ import static org.apache.ignite.transactions.TransactionConcurrency.*;
  */
 public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRestartSelfTest {
     /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-882");
-    }
-
-    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9314a68e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
index 62cc6b1..2d8f431 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
@@ -32,7 +32,7 @@ import static org.apache.ignite.transactions.TransactionConcurrency.*;
 public class GridCachePartitionedOptimisticTxNodeRestartTest extends GridCacheAbstractNodeRestartSelfTest {
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-882");
+        fail("https://issues.apache.org/jira/browse/IGNITE-1090");
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9314a68e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index 4269ea6..3461dd4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -28,11 +28,6 @@ import static org.apache.ignite.cache.CacheMode.*;
  */
 public class GridCacheReplicatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
     /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-882");
-    }
-
-    /** {@inheritDoc} */
     @Override protected CacheMode cacheMode() {
         return REPLICATED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9314a68e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
index dfdfd7e..8ce96cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
@@ -29,11 +29,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
  */
 public class GridCacheReplicatedNodeRestartSelfTest extends GridCacheAbstractNodeRestartSelfTest {
     /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-882");
-    }
-
-    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
 


[7/7] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-901

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-901


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

Branch: refs/heads/ignite-901
Commit: e3dd331378e634f94dd9516539981739765df175
Parents: 89fb395 9d0aa6f
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 7 17:55:32 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 7 17:55:32 2015 +0300

----------------------------------------------------------------------
 .../cache/eviction/fifo/FifoEvictionPolicy.java |   5 -
 .../cache/eviction/lru/LruEvictionPolicy.java   |   5 -
 .../eviction/sorted/SortedEvictionPolicy.java   |  19 +--
 .../processors/cache/CacheObjectImpl.java       |   1 -
 .../dht/GridPartitionedGetFuture.java           |  13 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  26 +++
 .../cache/CacheFutureExceptionSelfTest.java     | 171 +++++++++++++++++++
 .../GridCachePartitionedNodeRestartTest.java    |   5 -
 ...ePartitionedOptimisticTxNodeRestartTest.java |   2 +-
 .../GridCacheReplicatedFailoverSelfTest.java    |   5 -
 .../GridCacheReplicatedNodeRestartSelfTest.java |   5 -
 ...heConcurrentEvictionConsistencySelfTest.java |  15 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 13 files changed, 227 insertions(+), 46 deletions(-)
----------------------------------------------------------------------



[3/7] incubator-ignite git commit: #ignite-1101: Add test for cache future runtime exception.

Posted by sb...@apache.org.
#ignite-1101: Add test for cache future runtime exception.


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

Branch: refs/heads/ignite-901
Commit: 8c1ba5afe37d1e9f38d99738874046076556915f
Parents: 96c9695
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jul 7 13:40:11 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jul 7 13:40:11 2015 +0300

----------------------------------------------------------------------
 .../cache/CacheFutureExceptionSelfTest.java     | 171 +++++++++++++++++++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 2 files changed, 172 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8c1ba5af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
new file mode 100644
index 0000000..27bfe17
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
@@ -0,0 +1,171 @@
+/*
+ * 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.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+
+/**
+ * Cache future self test.
+ */
+public class CacheFutureExceptionSelfTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = StartNode.createConfiguration();
+
+        cfg.setClientMode(true);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAsyncCacheFuture() throws Exception {
+        final CountDownLatch readyLatch = new CountDownLatch(1);
+
+        GridJavaProcess node1 = null;
+
+        Collection<String> jvmArgs = Arrays.asList("-ea", "-DIGNITE_QUIET=false");
+
+        try {
+            node1 = GridJavaProcess.exec(
+                StartNode.class.getName(), null,
+                log,
+                new CI1<String>() {
+                    @Override public void apply(String s) {
+                        info("Server node1: " + s);
+
+                        if (s.contains("Topology snapshot"))
+                            readyLatch.countDown();
+                    }
+                },
+                null,
+                jvmArgs,
+                null
+            );
+
+            assertTrue(readyLatch.await(60, SECONDS));
+
+            Ignite client = startGrid(0);
+
+            IgniteCache<String, NotSerializableClass> cache = client.getOrCreateCache("CACHE");
+
+            cache.put("key", new NotSerializableClass());
+
+            System.setProperty("FAIL", "true");
+
+            IgniteCache<String, NotSerializableClass> asyncCache = cache.withAsync();
+
+            asyncCache.get("key");
+
+            final CountDownLatch futLatch = new CountDownLatch(1);
+
+            asyncCache.future().listen(new IgniteInClosure<IgniteFuture<Object>>() {
+                @Override public void apply(IgniteFuture<Object> fut) {
+                    assertTrue(fut.isDone());
+
+                    try {
+                        fut.get();
+
+                        fail();
+                    }
+                    catch (CacheException e) {
+                        log.info("Expected error: " + e);
+
+                        futLatch.countDown();
+                    }
+                }
+            });
+
+            assertTrue(futLatch.await(60, SECONDS));
+        }
+        finally {
+            if (node1 != null)
+                node1.killProcess();
+        }
+    }
+
+    /**
+     * Test class.
+     */
+    private static class NotSerializableClass implements Serializable {
+        /** {@inheritDoc}*/
+        private void writeObject(ObjectOutputStream out) throws IOException {
+            out.writeObject(this);
+        }
+
+        /** {@inheritDoc}*/
+        private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+            if (System.getProperty("FAIL") != null)
+                throw new RuntimeException("Deserialization failed.");
+
+            in.readObject();
+        }
+    }
+
+    /**
+     * Test class.
+     */
+    public static class StartNode {
+        /**
+         * @return Configuration.
+         */
+        public static IgniteConfiguration createConfiguration() {
+            IgniteConfiguration cfg = new IgniteConfiguration();
+
+            cfg.setPeerClassLoadingEnabled(true);
+
+            cfg.setLocalHost("127.0.0.1");
+
+            TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+            disco.setIpFinderCleanFrequency(1000);
+
+            TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
+
+            ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));
+
+            disco.setIpFinder(ipFinder);
+
+            cfg.setDiscoverySpi(disco);
+
+            return cfg;
+        }
+
+        /**
+         * @param args Main parameters.
+         */
+        public static void main(String[] args) {
+            Ignition.start(createConfiguration());
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8c1ba5af/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 0a31f49..39702a3 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
@@ -132,6 +132,7 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheObjectToStringSelfTest.class);
         suite.addTestSuite(GridCacheLoadOnlyStoreAdapterSelfTest.class);
         suite.addTestSuite(GridCacheGetStoreErrorSelfTest.class);
+        suite.addTestSuite(CacheFutureExceptionSelfTest.class);
         suite.addTestSuite(GridCacheAsyncOperationsLimitSelfTest.class);
         suite.addTestSuite(GridCacheTtlManagerSelfTest.class);
         suite.addTestSuite(GridCacheLifecycleAwareSelfTest.class);


[5/7] incubator-ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite

Posted by sb...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-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/44506c39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/44506c39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/44506c39

Branch: refs/heads/ignite-901
Commit: 44506c39da5baf887b72711795cdf50d01b87372
Parents: 9314a68 8c1ba5a
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Jul 7 14:13:57 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Jul 7 14:13:57 2015 +0300

----------------------------------------------------------------------
 .../cache/CacheFutureExceptionSelfTest.java     | 171 +++++++++++++++++++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 2 files changed, 172 insertions(+)
----------------------------------------------------------------------



[2/7] incubator-ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-901
Commit: 96c969527d6b0d3508c535c097c8a9cef774dc85
Parents: f2aa6ab b8a4b5a
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jul 7 10:35:22 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jul 7 10:35:22 2015 +0300

----------------------------------------------------------------------
 modules/rest-http/pom.xml | 2 +-
 modules/web/pom.xml       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------