@Test public void assertRegisterJobCompletedWhenNotMonitorExecution() { when(configService.isMonitorExecution()).thenReturn(false); executionService.registerJobCompleted(new JobExecutionMultipleShardingContext(), true); verify(configService).isMonitorExecution(); verify(serverService, times(0)).updateServerStatus(ServerStatus.READY); }
public void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag) { if (!configService.isMonitorExecution()) { return; } serverService.updateServerStatus(ServerStatus.READY); for (int each : jobExecutionShardingContext.getShardingItems()) { jobNodeStorage.replaceJobNode(ExecutionNode.getCompletedNode(each), completeFlag); jobNodeStorage.removeJobNodeIfExisted(ExecutionNode.getRunningNode(each)); jobNodeStorage.replaceJobNode(ExecutionNode.getLastCompleteTimeNode(each), System.currentTimeMillis()); } }
ExecutionService { public void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag) { if (!configService.isMonitorExecution()) { return; } serverService.updateServerStatus(ServerStatus.READY); for (int each : jobExecutionShardingContext.getShardingItems()) { jobNodeStorage.replaceJobNode(ExecutionNode.getCompletedNode(each), completeFlag); jobNodeStorage.removeJobNodeIfExisted(ExecutionNode.getRunningNode(each)); jobNodeStorage.replaceJobNode(ExecutionNode.getLastCompleteTimeNode(each), System.currentTimeMillis()); } } }
ExecutionService { public void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag) { if (!configService.isMonitorExecution()) { return; } serverService.updateServerStatus(ServerStatus.READY); for (int each : jobExecutionShardingContext.getShardingItems()) { jobNodeStorage.replaceJobNode(ExecutionNode.getCompletedNode(each), completeFlag); jobNodeStorage.removeJobNodeIfExisted(ExecutionNode.getRunningNode(each)); jobNodeStorage.replaceJobNode(ExecutionNode.getLastCompleteTimeNode(each), System.currentTimeMillis()); } } ExecutionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); }
ExecutionService { public void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag) { if (!configService.isMonitorExecution()) { return; } serverService.updateServerStatus(ServerStatus.READY); for (int each : jobExecutionShardingContext.getShardingItems()) { jobNodeStorage.replaceJobNode(ExecutionNode.getCompletedNode(each), completeFlag); jobNodeStorage.removeJobNodeIfExisted(ExecutionNode.getRunningNode(each)); jobNodeStorage.replaceJobNode(ExecutionNode.getLastCompleteTimeNode(each), System.currentTimeMillis()); } } ExecutionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void registerJobBegin(final JobExecutionMultipleShardingContext jobExecutionShardingContext); void cleanPreviousExecutionInfo(); void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag); void setNeedFixExecutionInfoFlag(); void clearRunningInfo(final List<Integer> items); boolean misfireIfNecessary(final List<Integer> items); void setMisfire(final List<Integer> items); List<Integer> getMisfiredJobItems(final List<Integer> items); void clearMisfire(final List<Integer> items); void removeExecutionInfo(); boolean isCompleted(final int item); boolean hasRunningItems(final List<Integer> items); boolean hasRunningItems(); }
ExecutionService { public void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag) { if (!configService.isMonitorExecution()) { return; } serverService.updateServerStatus(ServerStatus.READY); for (int each : jobExecutionShardingContext.getShardingItems()) { jobNodeStorage.replaceJobNode(ExecutionNode.getCompletedNode(each), completeFlag); jobNodeStorage.removeJobNodeIfExisted(ExecutionNode.getRunningNode(each)); jobNodeStorage.replaceJobNode(ExecutionNode.getLastCompleteTimeNode(each), System.currentTimeMillis()); } } ExecutionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void registerJobBegin(final JobExecutionMultipleShardingContext jobExecutionShardingContext); void cleanPreviousExecutionInfo(); void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext, boolean completeFlag); void setNeedFixExecutionInfoFlag(); void clearRunningInfo(final List<Integer> items); boolean misfireIfNecessary(final List<Integer> items); void setMisfire(final List<Integer> items); List<Integer> getMisfiredJobItems(final List<Integer> items); void clearMisfire(final List<Integer> items); void removeExecutionInfo(); boolean isCompleted(final int item); boolean hasRunningItems(final List<Integer> items); boolean hasRunningItems();  }