ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [06/44] incubator-ignite git commit: # ignite-1265
Date Fri, 21 Aug 2015 09:04:51 GMT
# ignite-1265


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 8b3fed850ccc4527a6593c5ec4e596ca6c08b61f
Parents: 5065a1e
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Aug 19 09:32:54 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Aug 19 10:26:10 2015 +0300

----------------------------------------------------------------------
 .../CachePartialUpdateCheckedException.java     | 11 ++++---
 ...teAtomicCacheEntryProcessorNodeJoinTest.java | 32 ++++++++++++++++++++
 .../IgniteCacheEntryProcessorNodeJoinTest.java  | 25 ++++++++-------
 .../testsuites/IgniteCacheTestSuite2.java       |  3 ++
 4 files changed, 55 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b3fed85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
index c2259df..fc846f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
@@ -47,8 +47,9 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException
{
      * Gets collection of failed keys.
      * @return Collection of failed keys.
      */
-    public <K> Collection<K> failedKeys() {
-        return (Collection<K>)failedKeys;
+    @SuppressWarnings("unchecked")
+    public synchronized <K> Collection<K> failedKeys() {
+        return new HashSet<>((Collection<K>)failedKeys);
     }
 
     /**
@@ -56,7 +57,7 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException
{
      * @param err Error.
      * @param topVer Topology version for failed update.
      */
-    public void add(Collection<?> failedKeys, Throwable err, AffinityTopologyVersion
topVer) {
+    public synchronized void add(Collection<?> failedKeys, Throwable err, AffinityTopologyVersion
topVer) {
         if (topVer != null) {
             AffinityTopologyVersion topVer0 = this.topVer;
 
@@ -72,7 +73,7 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException
{
     /**
      * @return Topology version.
      */
-    public AffinityTopologyVersion topologyVersion() {
+    public synchronized AffinityTopologyVersion topologyVersion() {
         return topVer;
     }
 
@@ -80,7 +81,7 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException
{
      * @param failedKeys Failed keys.
      * @param err Error.
      */
-    public void add(Collection<?> failedKeys, Throwable err) {
+    public synchronized void add(Collection<?> failedKeys, Throwable err) {
         add(failedKeys, err, null);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b3fed85/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteAtomicCacheEntryProcessorNodeJoinTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteAtomicCacheEntryProcessorNodeJoinTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteAtomicCacheEntryProcessorNodeJoinTest.java
new file mode 100644
index 0000000..af87a7d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteAtomicCacheEntryProcessorNodeJoinTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class IgniteAtomicCacheEntryProcessorNodeJoinTest extends IgniteCacheEntryProcessorNodeJoinTest
{
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b3fed85/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
index 94bfd8f..955a792 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.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.internal.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -51,9 +52,6 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
     /** Number of increment iterations. */
     private static final int NUM_SETS = 50;
 
-    /** Helper for excluding stopped node from iteration logic. */
-    private AtomicReferenceArray<Ignite> grids;
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -61,7 +59,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
         CacheConfiguration cache = new CacheConfiguration();
 
         cache.setCacheMode(PARTITIONED);
-        cache.setAtomicityMode(TRANSACTIONAL);
+        cache.setAtomicityMode(atomicityMode());
         cache.setWriteSynchronizationMode(FULL_SYNC);
         cache.setBackups(1);
         cache.setRebalanceMode(SYNC);
@@ -83,21 +81,21 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
         return cfg;
     }
 
+    /**
+     * @return Atomicity mode.
+     */
+    protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
         startGrids(GRID_CNT);
-
-        grids = new AtomicReferenceArray<>(GRID_CNT);
-
-        for (int i = 0; i < GRID_CNT; i++)
-            grids.set(i, grid(i));
     }
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
-
-        grids = null;
     }
 
     /**
@@ -115,6 +113,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
     }
 
     /**
+     * @param invokeAll If {@code true} tests invokeAll operation.
      * @throws Exception If failed.
      */
     private void checkEntryProcessorNodeJoin(boolean invokeAll) throws Exception {
@@ -163,6 +162,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
     }
 
     /**
+     * @param invokeAll If {@code true} tests invokeAll operation.
      * @throws Exception If failed.
      */
     private void checkIncrement(boolean invokeAll) throws Exception {
@@ -201,6 +201,9 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
         /** */
         private String val;
 
+        /**
+         * @param val Value.
+         */
         private Processor(String val) {
             this.val = val;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b3fed85/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index dcbab07..ec50399 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -140,6 +140,9 @@ public class IgniteCacheTestSuite2 extends TestSuite {
         suite.addTest(new TestSuite(IgniteCacheClientNodeChangingTopologyTest.class));
         suite.addTest(new TestSuite(IgniteCacheClientNodeConcurrentStart.class));
 
+        suite.addTest(new TestSuite(IgniteCacheEntryProcessorNodeJoinTest.class));
+        suite.addTest(new TestSuite(IgniteAtomicCacheEntryProcessorNodeJoinTest.class));
+
         return suite;
     }
 }


Mime
View raw message