master - Improve internal javadoc

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

Branch: refs/heads/ignite-5075
Commit: a20fe961e90c1f9b43f0a0771b3ef33b795e4006
Parents: d84fd29
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
Authored: Thu May 18 20:54:17 2017 +0300
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Thu May 18 20:54:17 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheSharedContext.java   | 17 ++++++++++++++++-
 .../preloader/GridDhtPartitionsExchangeFuture.java |  6 ++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a20fe961/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 55f3c42..1df74ef 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -41,6 +41,9 @@ import 
org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
 import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import 
org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
 import 
org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
 import org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter;
 import org.apache.ignite.internal.processors.cache.store.CacheStoreManager;
@@ -714,7 +717,19 @@ public class GridCacheSharedContext<K, V> {
     }
 
     /**
-     * Waits for partition locks and transactions release.
+     * Captures all ongoing operations that we need to wait before we can 
proceed to the next topology version.
+     * This method must be called only after
+     * {@link 
GridDhtPartitionTopology#updateTopologyVersion(GridDhtPartitionExchangeId, 
GridDhtPartitionsExchangeFuture, long, boolean)}
+     * method is called so that all new updates will wait to switch to the new 
version.
+     * This method will capture:
+     * <ul>
+     *     <li>All non-released cache locks</li>
+     *     <li>All non-committed transactions (local and remote)</li>
+     *     <li>All pending atomic updates</li>
+     *     <li>All pending DataStreamer updates</li>
+     * </ul>
+     *
+     * Captured updates are wrapped in a future that will be completed once 
pending objects are released.
      *
      * @param topVer Topology version.
      * @return {@code true} if waiting was successful.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a20fe961/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index b4cb3c1..544f847 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -837,6 +837,12 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter<AffinityT
     }
 
     /**
+     * The main purpose of this method is to wait for all ongoing updates 
(transactional and atomic), initiated on
+     * the previous topology version, to finish to prevent inconsistencies 
during rebalancing and to prevent two
+     * different simultaneous owners of the same lock.
+     * For the exact list of the objects being awaited for see
+     * {@link 
GridCacheSharedContext#partitionReleaseFuture(AffinityTopologyVersion)} javadoc.
+     *
      * @throws IgniteCheckedException If failed.
      */
     private void waitPartitionRelease() throws IgniteCheckedException {

Reply via email to