]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6732 add components from StartupLevel to CE container
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 14 Mar 2016 09:39:15 +0000 (10:39 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 21 Mar 2016 15:44:04 +0000 (16:44 +0100)
server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java

index 23be3d546da53d47cd58d5ee41d51eabc8c59f01..ad8abbfd0a9d1b6ac2d531a5e289c8c78f2b3569 100644 (file)
@@ -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();
 
index 9568d5dc882b5d11e179eed940b0f074043d9271..fd255a25fe4134343a751c84e81a1c3d725363a7 100644 (file)
@@ -84,6 +84,7 @@ public class ComputeEngineContainerImplTest {
         + 7 // content of CeQueueModule
         + 4 // content of ReportProcessingModule
         + 4 // content of CeTaskProcessorModule
+        + 3 // level startup
       );
   }