From 447c95967ca0c5468538cf100f9bcd4c76a8b8bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Mon, 14 Mar 2016 10:39:15 +0100 Subject: [PATCH] SONAR-6732 add components from StartupLevel to CE container --- .../container/ComputeEngineContainerImpl.java | 25 ++++++++++++++++++- .../ComputeEngineContainerImplTest.java | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java index 23be3d546da..ad8abbfd0a9 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java @@ -67,6 +67,7 @@ import org.sonar.server.computation.CeModule; import org.sonar.server.computation.container.ReportProcessingModule; import org.sonar.server.computation.property.CePropertyDefinitions; import org.sonar.server.computation.queue.CeQueueModule; +import org.sonar.server.computation.queue.PurgeCeActivities; import org.sonar.server.computation.taskprocessor.CeTaskProcessorModule; import org.sonar.server.debt.DebtModelPluginRepository; import org.sonar.server.debt.DebtRulesXMLImporter; @@ -125,6 +126,7 @@ import org.sonar.server.rule.RuleRepositories; import org.sonar.server.rule.index.RuleIndex; import org.sonar.server.rule.index.RuleIndexer; import org.sonar.server.search.EsSearchModule; +import org.sonar.server.startup.LogServerId; import org.sonar.server.startup.ServerMetadataPersister; import org.sonar.server.test.index.TestIndexer; import org.sonar.server.user.index.UserIndex; @@ -558,6 +560,26 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { // ComponentNavigationAction.class, no Web Service in CE // NavigationWs.class, no Web Service in CE }; + private static final Object[] STARTUP_COMPONENTS = new Object[] { + // IndexSynchronizer.class, ES maintenance, responsibility of Web Server + // RegisterMetrics.class, DB maintenance, responsibility of Web Server + // RegisterQualityGates.class, DB maintenance, responsibility of Web Server + // RegisterRules.class, DB maintenance, responsibility of Web Server + // RegisterQualityProfiles.class, DB maintenance, responsibility of Web Server + // GeneratePluginIndex.class, ES maintenance, responsibility of Web Server + // RegisterNewMeasureFilters.class, DB maintenance, responsibility of Web Server + // RegisterDashboards.class, UI related, anyway, DB maintenance, responsibility of Web Server + // RegisterPermissionTemplates.class, DB maintenance, responsibility of Web Server + // RenameDeprecatedPropertyKeys.class, DB maintenance, responsibility of Web Server + LogServerId.class, + // RegisterServletFilters.class, Web Server only + // RegisterIssueFilters.class, DB maintenance, responsibility of Web Server + // RenameIssueWidgets.class, UI related, anyway, DB maintenance, responsibility of Web Server + ServerLifecycleNotifier.class, + PurgeCeActivities.class, + // DisplayLogOnDeprecatedProjects.class, responsibility of Web Server + // ClearRulesOverloadedDebt.class, DB maintenance, responsibility of Web Server + }; private final ComponentContainer componentContainer; @@ -574,7 +596,8 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { .add(toArray(CePropertyDefinitions.all())) .add(LEVEL_2_COMPONENTS) .add(LEVEL_3_COMPONENTS) - .add(LEVEL_4_COMPONENTS); + .add(LEVEL_4_COMPONENTS) + .add(STARTUP_COMPONENTS); configureFromModules(); diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java index 9568d5dc882..fd255a25fe4 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java @@ -84,6 +84,7 @@ public class ComputeEngineContainerImplTest { + 7 // content of CeQueueModule + 4 // content of ReportProcessingModule + 4 // content of CeTaskProcessorModule + + 3 // level startup ); } -- 2.39.5