# IGNITE-187 Reworked kernal start to use @SkipDaemon annotation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e5f05c2e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e5f05c2e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e5f05c2e Branch: refs/heads/sprint-2 Commit: e5f05c2edfeeb1b701530bce147bc17acd2402cd Parents: 82f8d00 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Thu Mar 5 00:13:34 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Thu Mar 5 00:13:34 2015 +0700 ---------------------------------------------------------------------- .../apache/ignite/internal/IgniteKernal.java | 26 +++++++++----------- .../processors/job/GridJobProcessor.java | 1 + 2 files changed, 12 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5f05c2e/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index 3cb39c8..9fd2920 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -802,12 +802,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { if (comp instanceof GridIoManager) continue; - if (!skipDaemon(comp)) { - if (log.isDebugEnabled()) - log.debug("Skipping onKernalStart on daemon node for component: " + comp); - + if (!skipDaemon(comp)) comp.onKernalStart(); - } } // Register MBeans. @@ -1381,7 +1377,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { ctx.add(mgr); try { - mgr.start(); + if (!skipDaemon(mgr)) + mgr.start(); } catch (IgniteCheckedException e) { throw new IgniteCheckedException("Failed to start manager: " + mgr, e); @@ -1396,7 +1393,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { ctx.add(proc); try { - proc.start(); + if (!skipDaemon(proc)) + proc.start(); } catch (IgniteCheckedException e) { throw new IgniteCheckedException("Failed to start processor: " + proc, e); @@ -1705,12 +1703,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { GridComponent comp = it.previous(); try { - if (!skipDaemon(comp)) { - if (log.isDebugEnabled()) - log.debug("Skipping onKernalStop on daemon node for component: " + comp); - + if (!skipDaemon(comp)) comp.onKernalStop(cancel); - } } catch (Throwable e) { errOnStop = true; @@ -1784,10 +1778,12 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { GridComponent comp = it.previous(); try { - comp.stop(cancel); + if (!skipDaemon(comp)) { + comp.stop(cancel); - if (log.isDebugEnabled()) - log.debug("Component stopped: " + comp); + if (log.isDebugEnabled()) + log.debug("Component stopped: " + comp); + } } catch (Throwable e) { errOnStop = true; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5f05c2e/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java index fc0627b..6b753b4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java @@ -52,6 +52,7 @@ import static org.jdk8.backport.ConcurrentLinkedHashMap.QueuePolicy.*; /** * Responsible for all grid job execution and communication. */ +@SkipDaemon public class GridJobProcessor extends GridProcessorAdapter { /** */ private static final int FINISHED_JOBS_COUNT = Integer.getInteger(IGNITE_JOBS_HISTORY_SIZE, 10240);