ignite-1093 Code cleanup
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/76ba5d95 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/76ba5d95 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/76ba5d95 Branch: refs/heads/ignite-1093 Commit: 76ba5d953133448b2753c0727098e7552ff79753 Parents: 9fbb559 Author: Anton Vinogradov <vinogradov.an...@gmail.com> Authored: Mon Aug 10 12:46:26 2015 +0300 Committer: Anton Vinogradov <vinogradov.an...@gmail.com> Committed: Mon Aug 10 12:46:26 2015 +0300 ---------------------------------------------------------------------- .../dht/preloader/GridDhtPartitionDemander.java | 21 ++++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76ba5d95/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java index 711b69b..fdd101e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java @@ -54,9 +54,6 @@ import static org.apache.ignite.internal.processors.dr.GridDrType.*; */ @SuppressWarnings("NonConstantFieldWithUpperCaseName") public class GridDhtPartitionDemander { - /** Dummy message to wake up a blocking queue if a node leaves. */ - private final SupplyMessage DUMMY_TOP = new SupplyMessage(); - /** */ private final GridCacheContext<?, ?> cctx; @@ -259,14 +256,6 @@ public class GridDhtPartitionDemander { } /** - * @param msg Message to check. - * @return {@code True} if dummy message. - */ - private boolean dummyTopology(SupplyMessage msg) { - return msg == DUMMY_TOP; - } - - /** * @param deque Deque to poll from. * @param time Time to wait. * @param w Worker. @@ -558,8 +547,14 @@ public class GridDhtPartitionDemander { cctx.io().addOrderedHandler(topic(cnt, cctx.cacheId(), node.id()), new CI2<UUID, GridDhtPartitionSupplyMessage>() { @Override public void apply(UUID id, GridDhtPartitionSupplyMessage m) { - handleSupplyMessage(idx, new SupplyMessage(id, m), node, topVer, top, - exchFut, missed, d, remaining); + enterBusy(); + + try { + handleSupplyMessage(idx, new SupplyMessage(id, m), node, topVer, top, + exchFut, missed, d, remaining); + }finally{ + leaveBusy(); + } } });