ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] ignite git commit: zk
Date Thu, 07 Dec 2017 09:49:40 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-zk d3a80fb03 -> a11e06a5b


zk


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

Branch: refs/heads/ignite-zk
Commit: 3d1c0e88dea6569ceddfd015ceae6f66f4483ad3
Parents: d3a80fb
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Dec 7 11:09:48 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Dec 7 11:09:48 2017 +0300

----------------------------------------------------------------------
 .../discovery/zk/internal/ZookeeperClient.java  |  4 +--
 .../ZookeeperDiscoverySpiBasicTest.java         | 35 ++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1c0e88/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java
index e2ec675..4886572 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java
@@ -38,7 +38,7 @@ import org.apache.zookeeper.data.Stat;
 import org.jetbrains.annotations.Nullable;
 
 /**
- *
+ * TODO ZK: limit reconnect attempts.
  */
 public class ZookeeperClient implements Watcher {
     /** */
@@ -683,7 +683,7 @@ public class ZookeeperClient implements Watcher {
                 else {
                     assert connStartTime != 0;
 
-                    assert state == ConnectionState.Disconnected;
+                    assert state == ConnectionState.Disconnected : state;
 
                     remainingTime = connLossTimeout - (System.currentTimeMillis() - connStartTime);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1c0e88/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java
index c2e4aba..56d1eaf 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java
@@ -42,6 +42,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
@@ -1360,6 +1361,40 @@ public class ZookeeperDiscoverySpiBasicTest extends GridCommonAbstractTest
{
     /**
      * @throws Exception If failed.
      */
+    public void testLargeCustomEvent() throws Exception {
+        Ignite srv0 = startGrid(0);
+
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>("c1");
+
+        ccfg.setAffinity(new TestAffinityFunction(1024 * 1024));
+
+        srv0.createCache(ccfg);
+    }
+
+    /**
+     *
+     */
+    static class TestAffinityFunction extends RendezvousAffinityFunction {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private int[] dummyData;
+
+        /**
+         * @param dataSize Dummy data size.
+         */
+        TestAffinityFunction(int dataSize) {
+            dummyData = new int[dataSize];
+
+            for (int i = 0; i < dataSize; i++)
+                dummyData[i] = i;
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testClientReconnectSessionExpire1_1() throws Exception {
        clientReconnectSessionExpire(false);
     }


Mime
View raw message