# GG-9830 Review.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ac243813 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ac243813 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ac243813 Branch: refs/heads/ignite-757 Commit: ac243813dbf940c9a7205e15948aaee557e4b123 Parents: a003045 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Tue Apr 28 07:40:57 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Tue Apr 28 07:40:57 2015 +0700 ---------------------------------------------------------------------- .../internal/cluster/ClusterGroupAdapter.java | 27 ++++++++++---------- .../node/VisorNodeEventsCollectorTask.java | 8 ++++-- 2 files changed, 20 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac243813/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java index be91d19..bb82c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java @@ -528,38 +528,39 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable { return forPredicate(new OthersFilter(excludeIds)); } - /** {@inheritDoc} */ - @Override public final ClusterGroup forCacheNodes(@Nullable String cacheName) { + /** + * @throws IllegalStateException In case of daemon node. + */ + private void checkDaemon() throws IllegalStateException { if (ctx.isDaemon()) throw new IllegalStateException("Not applicable for the daemon node."); + } + + /** {@inheritDoc} */ + @Override public final ClusterGroup forCacheNodes(@Nullable String cacheName) { + checkDaemon(); return forPredicate(new CachesFilter(cacheName, true, true, true)); } /** {@inheritDoc} */ @Override public final ClusterGroup forDataNodes(@Nullable String cacheName) { - if (ctx.isDaemon()) - throw new IllegalStateException("Not applicable for the daemon node."); + checkDaemon(); return forPredicate(new CachesFilter(cacheName, true, false, false)); } /** {@inheritDoc} */ @Override public final ClusterGroup forClientNodes(@Nullable String cacheName) { - if (ctx.isDaemon()) - throw new IllegalStateException("Not applicable for the daemon node."); + checkDaemon(); return forPredicate(new CachesFilter(cacheName, false, true, true)); } /** {@inheritDoc} */ - @Override public ClusterGroup forCacheNodes(@Nullable String cacheName, - boolean affNodes, - boolean nearNodes, - boolean clientNodes) - { - if (ctx.isDaemon()) - throw new IllegalStateException("Not applicable for the daemon node."); + @Override public ClusterGroup forCacheNodes(@Nullable String cacheName, boolean affNodes, boolean nearNodes, + boolean clientNodes) { + checkDaemon(); return forPredicate(new CachesFilter(cacheName, affNodes, nearNodes, clientNodes)); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac243813/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java index a5f64d9..3b3d8dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java @@ -24,6 +24,7 @@ import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.visor.*; import org.apache.ignite.internal.visor.event.*; +import org.apache.ignite.internal.visor.util.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; @@ -259,7 +260,10 @@ public class VisorNodeEventsCollectorTask extends VisorMultiNodeTask<VisorNodeEv return true; } - protected IgniteClosure<Event, VisorGridEvent> eventMapper() { + /** + * @return Events mapper. + */ + protected VisorEventMapper eventMapper() { return EVT_MAPPER; } @@ -279,7 +283,7 @@ public class VisorNodeEventsCollectorTask extends VisorMultiNodeTask<VisorNodeEv @Override public boolean apply(Event evt) { return evt.localOrder() > startEvtOrder && (arg.typeArgument() == null || F.contains(arg.typeArgument(), evt.type())) && - evt.timestamp() >= startEvtTime && + (evt.timestamp() >= startEvtTime) && (arg.taskName() == null || filterByTaskName(evt, arg.taskName())) && (arg.taskSessionId() == null || filterByTaskSessionId(evt, arg.taskSessionId())); }