ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: # ignite-preload-debug.
Date Wed, 25 Feb 2015 10:35:40 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-preload-debug [created] 645267532


# ignite-preload-debug.


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

Branch: refs/heads/ignite-preload-debug
Commit: 6452675322d86a464db14ded0c85c3a3432e0844
Parents: 98f177f
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Wed Feb 25 17:35:35 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Wed Feb 25 17:35:35 2015 +0700

----------------------------------------------------------------------
 .../preloader/GridDhtPartitionDemandPool.java   | 36 +++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64526753/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
index 6a1f7a1..d7f0caf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java
@@ -109,6 +109,8 @@ public class GridDhtPartitionDemandPool<K, V> {
 
         poolSize = cctx.preloadEnabled() ? cctx.config().getPreloadThreadPoolSize() : 0;
 
+        U.debug(">>>>>>>> Pool size = " + poolSize);
+
         if (poolSize > 0) {
             barrier = new CyclicBarrier(poolSize);
 
@@ -135,16 +137,22 @@ public class GridDhtPartitionDemandPool<K, V> {
      *
      */
     void start() {
+        U.debug(">>>>>>>> Start 1");
+
         if (poolSize > 0) {
             for (DemandWorker w : dmdWorkers)
                 new IgniteThread(cctx.gridName(), "preloader-demand-worker", w).start();
         }
+
+        U.debug(">>>>>>>> Start 2");
     }
 
     /**
      *
      */
     void stop() {
+        U.debug(">>>>>>>> Stop 1");
+
         U.cancel(dmdWorkers);
 
         if (log.isDebugEnabled())
@@ -158,6 +166,8 @@ public class GridDhtPartitionDemandPool<K, V> {
         lastExchangeFut = null;
 
         lastTimeoutObj.set(null);
+
+        U.debug(">>>>>>>> Stop 2");
     }
 
     /**
@@ -197,6 +207,8 @@ public class GridDhtPartitionDemandPool<K, V> {
      * Force preload.
      */
     void forcePreload() {
+        U.debug(">>>>>>>> forcePreload 1");
+
         GridTimeoutObject obj = lastTimeoutObj.getAndSet(null);
 
         if (obj != null)
@@ -216,14 +228,23 @@ public class GridDhtPartitionDemandPool<K, V> {
         }
         else if (log.isDebugEnabled())
             log.debug("Ignoring force preload request (no topology event happened yet).");
+
+        U.debug(">>>>>>>> forcePreload 2");
     }
 
     /**
      * @return {@code true} if entered to busy state.
      */
     private boolean enterBusy() {
-        if (busyLock.readLock().tryLock())
+        U.debug(">>>>>>>> enterBusy 1");
+
+        if (busyLock.readLock().tryLock()) {
+            U.debug(">>>>>>>> enterBusy 2 - true");
+
             return true;
+        }
+
+        U.debug(">>>>>>>> enterBusy 3 - false");
 
         if (log.isDebugEnabled())
             log.debug("Failed to enter to busy state (demander is stopping): " + cctx.nodeId());
@@ -293,6 +314,8 @@ public class GridDhtPartitionDemandPool<K, V> {
      * @return Picked owners.
      */
     private Collection<ClusterNode> pickedOwners(int p, long topVer) {
+        U.debug(">>>>>>>> pickedOwners 1");
+
         Collection<ClusterNode> affNodes = cctx.affinity().nodes(p, topVer);
 
         int affCnt = affNodes.size();
@@ -309,6 +332,8 @@ public class GridDhtPartitionDemandPool<K, V> {
         // Sort in descending order, so nodes with higher order will be first.
         Collections.sort(sorted, CU.nodeComparator(false));
 
+        U.debug(">>>>>>>> pickedOwners 2");
+
         // Pick newest nodes.
         return sorted.subList(0, affCnt);
     }
@@ -483,6 +508,8 @@ public class GridDhtPartitionDemandPool<K, V> {
          */
         private boolean preloadEntry(ClusterNode pick, int p, GridCacheEntryInfo<K, V>
entry, long topVer)
             throws IgniteCheckedException {
+            U.debug("]]]]]]]]]]]]] DemandWorker " + id + "preloadEntry 1");
+            try {
             try {
                 GridCacheEntryEx<K, V> cached = null;
 
@@ -549,6 +576,10 @@ public class GridDhtPartitionDemandPool<K, V> {
             }
 
             return true;
+            }
+            finally {
+                U.debug("]]]]]]]]]]]]] DemandWorker " + id + "preloadEntry 2");
+            }
         }
 
         /**
@@ -571,6 +602,8 @@ public class GridDhtPartitionDemandPool<K, V> {
          */
         private Set<Integer> demandFromNode(ClusterNode node, final long topVer, GridDhtPartitionDemandMessage<K,
V> d,
             GridDhtPartitionsExchangeFuture<K, V> exchFut) throws InterruptedException,
IgniteCheckedException {
+            U.debug("]]]]]]]]]]]]] DemandWorker " + id + "demandFromNode 1");
+
             GridDhtPartitionTopology<K, V> top = cctx.dht().topology();
 
             cntr++;
@@ -791,6 +824,7 @@ public class GridDhtPartitionDemandPool<K, V> {
             }
             finally {
                 cctx.io().removeOrderedHandler(d.topic());
+                U.debug("]]]]]]]]]]]]] DemandWorker " + id + "demandFromNode 2");
             }
         }
 


Mime
View raw message