ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/7] ignite git commit: IO opts : disabled backpressure control + fair affinity
Date Fri, 09 Sep 2016 14:01:51 GMT
IO opts : disabled backpressure control + fair affinity


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

Branch: refs/heads/ignite-comm-opts1
Commit: 9d3cc2dcfed7d6dbba7a924d6ff9cd31242eda2d
Parents: 24d8cc8
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Mon Sep 5 18:06:03 2016 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon Sep 5 18:06:03 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    |  7 +++--
 .../util/nio/GridSelectorNioSessionImpl.java    |  2 +-
 .../communication/tcp/TcpCommunicationSpi.java  | 32 ++++++++++----------
 .../cache/GridCacheAbstractSelfTest.java        |  7 +++++
 4 files changed, 29 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9d3cc2dc/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 e104b87..9690c0c 100755
--- 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
@@ -51,6 +51,7 @@ import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cache.affinity.AffinityFunction;
 import org.apache.ignite.cache.affinity.AffinityFunctionContext;
 import org.apache.ignite.cache.affinity.AffinityNodeAddressHashResolver;
+import org.apache.ignite.cache.affinity.fair.FairAffinityFunction;
 import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
 import org.apache.ignite.cache.store.CacheStore;
 import org.apache.ignite.cache.store.CacheStoreSessionListener;
@@ -226,11 +227,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
         if (cfg.getAffinity() == null) {
             if (cfg.getCacheMode() == PARTITIONED) {
-                RendezvousAffinityFunction aff = new RendezvousAffinityFunction();
+                FairAffinityFunction aff = new FairAffinityFunction();
 
-                aff.setHashIdResolver(new AffinityNodeAddressHashResolver());
+                //aff.setHashIdResolver(new AffinityNodeAddressHashResolver());
 
                 cfg.setAffinity(aff);
+
+                U.debug(log, ">>> Set FAIR affinity for cache: " + cfg.getName());
             }
             else if (cfg.getCacheMode() == REPLICATED) {
                 RendezvousAffinityFunction aff = new RendezvousAffinityFunction(false, 512);

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d3cc2dc/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
index 0ba6af2..487b11a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
@@ -103,7 +103,7 @@ class GridSelectorNioSessionImpl extends GridNioSessionImpl {
 
         this.selectorIdx = selectorIdx;
 
-        sem = sndQueueLimit > 0 ? new Semaphore(sndQueueLimit) : null;
+        sem = null;//sndQueueLimit > 0 ? new Semaphore(sndQueueLimit) : null;
 
         if (writeBuf != null) {
             writeBuf.clear();

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d3cc2dc/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 b2c73d7..d12c6bf 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
@@ -583,22 +583,22 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     }
 
                     IgniteRunnable c;
-
-                    if (msgQueueLimit > 0) {
-                        GridNioMessageTracker tracker = ses.meta(TRACKER_META);
-
-                        if (tracker == null) {
-                            GridNioMessageTracker old = ses.addMeta(TRACKER_META, tracker
=
-                                new GridNioMessageTracker(ses, msgQueueLimit));
-
-                            assert old == null;
-                        }
-
-                        tracker.onMessageReceived();
-
-                        c = tracker;
-                    }
-                    else
+//
+//                    if (msgQueueLimit > 0) {
+//                        GridNioMessageTracker tracker = ses.meta(TRACKER_META);
+//
+//                        if (tracker == null) {
+//                            GridNioMessageTracker old = ses.addMeta(TRACKER_META, tracker
=
+//                                new GridNioMessageTracker(ses, msgQueueLimit));
+//
+//                            assert old == null;
+//                        }
+//
+//                        tracker.onMessageReceived();
+//
+//                        c = tracker;
+//                    }
+//                    else
                         c = NOOP;
 
                     notifyListener(sndId, msg, c);

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d3cc2dc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index af31635..8a3930e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -48,6 +48,7 @@ import org.apache.ignite.internal.util.typedef.R1;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
 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;
@@ -217,6 +218,12 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest
{
 
         cfg.setCacheConfiguration(cacheConfiguration(gridName));
 
+        TcpCommunicationSpi comm = new TcpCommunicationSpi();
+
+        comm.setSharedMemoryPort(-1);
+
+        cfg.setCommunicationSpi(comm);
+
         return cfg;
     }
 


Mime
View raw message