diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-21 17:06:09 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-24 14:00:32 +0200 |
commit | 2bfefbed900d10ee2320630c83f13d21346a1bb8 (patch) | |
tree | a73f22584e12cafb81a4be6d98a138347c84f59a | |
parent | edd8aac1c6352e3857475390b7431f3c8baef010 (diff) | |
download | sonarqube-2bfefbed900d10ee2320630c83f13d21346a1bb8.tar.gz sonarqube-2bfefbed900d10ee2320630c83f13d21346a1bb8.zip |
rename ComputeEngineBatchExecutorService for clarity and consistency
new name is ReportProcessingSchedulerExecutorService
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java | 2 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingScheduler.java | 12 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorService.java (renamed from server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorService.java) | 2 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorServiceImpl.java (renamed from server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorServiceImpl.java) | 8 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessor.java | 6 | ||||
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/computation/ReportProcessingSchedulerTest.java | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java index 39a21a27997..c48cb432f7d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineProcessingModule.java @@ -26,7 +26,7 @@ public class ComputeEngineProcessingModule extends Module { protected void configureModule() { add( ReportProcessingScheduler.class, - ComputeEngineBatchExecutorServiceImpl.class, + ReportProcessingSchedulerExecutorServiceImpl.class, ComputeEngineProcessingExecutorServiceImpl.class, ComputeEngineProcessingQueueImpl.class); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingScheduler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingScheduler.java index e294f406207..1bc6f36d11c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingScheduler.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingScheduler.java @@ -32,7 +32,7 @@ import org.sonar.server.computation.container.ContainerFactoryImpl; */ public class ReportProcessingScheduler implements ServerStartHandler { - private final ComputeEngineBatchExecutorService batchExecutorService; + private final ReportProcessingSchedulerExecutorService reportProcessingSchedulerExecutorService; private final ComputeEngineProcessingQueue processingQueue; private final ReportQueue queue; private final ComponentContainer sqContainer; @@ -42,10 +42,10 @@ public class ReportProcessingScheduler implements ServerStartHandler { private final long delayForFirstStart; private final TimeUnit timeUnit; - public ReportProcessingScheduler(ComputeEngineBatchExecutorService batchExecutorService, + public ReportProcessingScheduler(ReportProcessingSchedulerExecutorService reportProcessingSchedulerExecutorService, ComputeEngineProcessingQueue processingQueue, ReportQueue queue, ComponentContainer sqContainer) { - this.batchExecutorService = batchExecutorService; + this.reportProcessingSchedulerExecutorService = reportProcessingSchedulerExecutorService; this.processingQueue = processingQueue; this.queue = queue; this.sqContainer = sqContainer; @@ -57,15 +57,15 @@ public class ReportProcessingScheduler implements ServerStartHandler { } public void startAnalysisTaskNow() { - batchExecutorService.execute(new AddBatchProcessingCETaskRunnable()); + reportProcessingSchedulerExecutorService.execute(new AddReportProcessingToCEProcessingQueue()); } @Override public void onServerStart(Server server) { - batchExecutorService.scheduleAtFixedRate(new AddBatchProcessingCETaskRunnable(), delayForFirstStart, delayBetweenTasks, timeUnit); + reportProcessingSchedulerExecutorService.scheduleAtFixedRate(new AddReportProcessingToCEProcessingQueue(), delayForFirstStart, delayBetweenTasks, timeUnit); } - private class AddBatchProcessingCETaskRunnable implements Runnable { + private class AddReportProcessingToCEProcessingQueue implements Runnable { @Override public void run() { processingQueue.addTask(new ReportProcessingTask(queue, sqContainer, containerFactory)); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorService.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorService.java index 3f1618ca37b..22b502a342d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorService.java @@ -25,5 +25,5 @@ import org.sonar.server.util.StoppableExecutorService; /** * ExecutorService responsible for adding {@link ReportProcessingTask} to {@link ReportQueue} on a regular basis. */ -public interface ComputeEngineBatchExecutorService extends ScheduledExecutorService, StoppableExecutorService { +public interface ReportProcessingSchedulerExecutorService extends ScheduledExecutorService, StoppableExecutorService { } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorServiceImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorServiceImpl.java index df1c8e2cbf3..a123c9f1de8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputeEngineBatchExecutorServiceImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessingSchedulerExecutorServiceImpl.java @@ -27,11 +27,11 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import org.sonar.server.util.AbstractStoppableExecutorService; -public class ComputeEngineBatchExecutorServiceImpl extends AbstractStoppableExecutorService<ScheduledExecutorService> - implements ComputeEngineBatchExecutorService { - private static final String THREAD_NAME_PREFIX = "ce-batch-scheduler-"; +public class ReportProcessingSchedulerExecutorServiceImpl extends AbstractStoppableExecutorService<ScheduledExecutorService> + implements ReportProcessingSchedulerExecutorService { + private static final String THREAD_NAME_PREFIX = "ce-report-scheduler-"; - public ComputeEngineBatchExecutorServiceImpl() { + public ReportProcessingSchedulerExecutorServiceImpl() { super( Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessor.java index 7ae3b3a267d..958cbae3d2d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessor.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ReportProcessor.java @@ -39,7 +39,7 @@ public class ReportProcessor { ReportQueue.Item item, ActivityManager activityManager, System2 system, CEQueueStatus queueStatus) { this.executor = new ComputationStepExecutor( Loggers.get(ReportProcessor.class), - new BatchReportStepsExecutorListener(item, system, activityManager, queueStatus), + new ReportProcessingStepsExecutorListener(item, system, activityManager, queueStatus), createDescription(item), queueStatus); this.steps = steps; } @@ -53,12 +53,12 @@ public class ReportProcessor { return format("Analysis of project %s (report %d)", projectKey, item.dto.getId()); } - private static class BatchReportStepsExecutorListener implements ComputationStepExecutor.Listener { + private static class ReportProcessingStepsExecutorListener implements ComputationStepExecutor.Listener { private final ReportQueue.Item item; private final System2 system; private final ActivityManager activityManager; - private BatchReportStepsExecutorListener(ReportQueue.Item item, System2 system, ActivityManager activityManager, CEQueueStatus queueStatus) { + private ReportProcessingStepsExecutorListener(ReportQueue.Item item, System2 system, ActivityManager activityManager, CEQueueStatus queueStatus) { this.item = item; this.system = system; this.activityManager = activityManager; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ReportProcessingSchedulerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ReportProcessingSchedulerTest.java index 8a5382b7c9f..2d1a5d3ed0f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ReportProcessingSchedulerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ReportProcessingSchedulerTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.when; public class ReportProcessingSchedulerTest { - ComputeEngineBatchExecutorService batchExecutorService = mock(ComputeEngineBatchExecutorService.class); + ReportProcessingSchedulerExecutorService batchExecutorService = mock(ReportProcessingSchedulerExecutorService.class); SimpleComputeEngineProcessingQueue processingQueue = new SimpleComputeEngineProcessingQueue(); ReportQueue queue = mock(ReportQueue.class); ComponentContainer componentContainer = mock(ComponentContainer.class); |