#ignite-373: Change flag removeAll to retry in DistributedCacheAdapter.removeAll
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/48fdafac Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/48fdafac Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/48fdafac Branch: refs/heads/ignite-373 Commit: 48fdafac9aac6b47c091d587da0f74f7fad8b015 Parents: 3dd16ba Author: ivasilinets <[email protected]> Authored: Wed May 13 12:12:16 2015 +0300 Committer: ivasilinets <[email protected]> Committed: Wed May 13 12:12:16 2015 +0300 ---------------------------------------------------------------------- .../cache/distributed/GridDistributedCacheAdapter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/48fdafac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java index 3878c67..6f939e1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java @@ -143,10 +143,10 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter try { AffinityTopologyVersion topVer; - Boolean rmvAll; + boolean retry = false; do { - rmvAll = true; + retry = false; topVer = ctx.affinity().affinityTopologyVersion(); @@ -156,10 +156,10 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter if (!nodes.isEmpty()) { ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes); - rmvAll = ctx.kernalContext().task().execute(new RemoveAllTask(ctx), null).get(); + retry = !ctx.kernalContext().task().execute(new RemoveAllTask(ctx), null).get(); } } - while (ctx.affinity().affinityTopologyVersion().compareTo(topVer) != 0 || rmvAll == null || !rmvAll); + while (ctx.affinity().affinityTopologyVersion().compareTo(topVer) != 0 || retry); } catch (ClusterGroupEmptyCheckedException ignore) { if (log.isDebugEnabled()) @@ -193,11 +193,11 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter rmvAll.listen(new IgniteInClosure<IgniteInternalFuture<Boolean>>() { @Override public void apply(IgniteInternalFuture<Boolean> fut) { try { - Boolean res = fut.get(); + boolean retry = !fut.get(); AffinityTopologyVersion topVer0 = ctx.affinity().affinityTopologyVersion(); - if (topVer0.equals(topVer) && res != null && res) + if (topVer0.equals(topVer) && !retry) opFut.onDone(); else removeAllAsync(opFut, topVer0);
