ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-6149
Date Fri, 15 Sep 2017 10:25:41 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-6149 5c7f6a5e3 -> 06ce6871b


ignite-6149


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

Branch: refs/heads/ignite-6149
Commit: 06ce6871b18c968023af458f3e118b80be306638
Parents: 5c7f6a5
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Sep 15 13:25:35 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Sep 15 13:25:35 2017 +0300

----------------------------------------------------------------------
 .../mvcc/CacheCoordinatorsSharedManager.java    | 36 ++++++++++++++------
 1 file changed, 26 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/06ce6871/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
index 9273cdd..2450dfd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
@@ -64,6 +64,9 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
     public static final long COUNTER_NA = 0L;
 
     /** */
+    public static final boolean STAT_CNTRS = true;
+
+    /** */
     private static final GridTopic MSG_TOPIC = TOPIC_CACHE_COORDINATOR;
 
     /** */
@@ -124,10 +127,12 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
      * @param log Logger.
      */
     public void dumpStatistics(IgniteLogger log) {
-        log.info("Mvcc coordinator statistics: ");
+        if (STAT_CNTRS) {
+            log.info("Mvcc coordinator statistics: ");
 
-        for (StatCounter cntr : statCntrs)
-            cntr.dumpInfo(log);
+            for (StatCounter cntr : statCntrs)
+                cntr.dumpInfo(log);
+        }
     }
 
     /**
@@ -318,7 +323,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
 
         MvccCoordinatorVersionResponse res = assignTxCounter(msg.txId(), msg.futureId());
 
-        statCntrs[0].update(res.activeTransactions());
+        if (STAT_CNTRS)
+            statCntrs[0].update(res.activeTransactions());
 
         try {
             cctx.gridIO().sendToGridTopic(node,
@@ -379,7 +385,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         MvccVersionFuture fut = verFuts.remove(msg.futureId());
 
         if (fut != null) {
-            statCntrs[1].update((System.nanoTime() - fut.startTime) * 1000);
+            if (STAT_CNTRS)
+                statCntrs[1].update((System.nanoTime() - fut.startTime) * 1000);
 
             fut.onResponse(msg);
         }
@@ -405,7 +412,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
     private void processCoordinatorTxAckRequest(UUID nodeId, CoordinatorTxAckRequest msg)
{
         onTxDone(msg.txId());
 
-        statCntrs[2].update();
+        if (STAT_CNTRS)
+            statCntrs[2].update();
 
         if (!msg.skipResponse()) {
             try {
@@ -432,7 +440,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         WaitAckFuture fut = ackFuts.remove(msg.futureId());
 
         if (fut != null) {
-            statCntrs[3].update((System.nanoTime() - fut.startTime) * 1000);
+            if (STAT_CNTRS)
+                statCntrs[3].update((System.nanoTime() - fut.startTime) * 1000);
 
             fut.onResponse();
         }
@@ -673,7 +682,7 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         public final ClusterNode crd;
 
         /** */
-        final long startTime = System.nanoTime();
+        long startTime;
 
         /**
          * @param id Future ID.
@@ -683,6 +692,9 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
             this.id = id;
             this.crd = crd;
             this.tx = tx;
+
+            if (STAT_CNTRS)
+                startTime = System.nanoTime();
         }
 
         /**
@@ -724,7 +736,7 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         private final ClusterNode crd;
 
         /** */
-        final long startTime = System.nanoTime();
+        long startTime;
 
         /**
          * @param id Future ID.
@@ -733,6 +745,9 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         WaitAckFuture(long id, ClusterNode crd) {
             this.id = id;
             this.crd = crd;
+
+            if (STAT_CNTRS)
+                startTime = System.nanoTime();
         }
 
         /**
@@ -786,7 +801,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
     private class CoordinatorMessageListener implements GridMessageListener {
         /** {@inheritDoc} */
         @Override public void onMessage(UUID nodeId, Object msg, byte plc) {
-            statCntrs[4].update();
+            if (STAT_CNTRS)
+                statCntrs[4].update();
 
             MvccCoordinatorMessage msg0 = (MvccCoordinatorMessage)msg;
 


Mime
View raw message