@Test public void assertAddDaemonWithOverJobQueueSize() { when(regCenter.getNumChildren(ReadyNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); readyService.addDaemon("test_job"); verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); }
public void addDaemon(final String jobName) { if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } Optional<CloudJobConfigurationPOJO> cloudJobConfig = configService.load(jobName); if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { return; } regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); }
ReadyService { public void addDaemon(final String jobName) { if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } Optional<CloudJobConfigurationPOJO> cloudJobConfig = configService.load(jobName); if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { return; } regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); } }
ReadyService { public void addDaemon(final String jobName) { if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } Optional<CloudJobConfigurationPOJO> cloudJobConfig = configService.load(jobName); if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { return; } regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); } ReadyService(final CoordinatorRegistryCenter regCenter); }
ReadyService { public void addDaemon(final String jobName) { if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } Optional<CloudJobConfigurationPOJO> cloudJobConfig = configService.load(jobName); if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { return; } regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); } ReadyService(final CoordinatorRegistryCenter regCenter); void addTransient(final String jobName); void addDaemon(final String jobName); void setMisfireDisabled(final String jobName); Collection<JobContext> getAllEligibleJobContexts(final Collection<JobContext> ineligibleJobContexts); void remove(final Collection<String> jobNames); Map<String, Integer> getAllReadyTasks(); }
ReadyService { public void addDaemon(final String jobName) { if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } Optional<CloudJobConfigurationPOJO> cloudJobConfig = configService.load(jobName); if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { return; } regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); } ReadyService(final CoordinatorRegistryCenter regCenter); void addTransient(final String jobName); void addDaemon(final String jobName); void setMisfireDisabled(final String jobName); Collection<JobContext> getAllEligibleJobContexts(final Collection<JobContext> ineligibleJobContexts); void remove(final Collection<String> jobNames); Map<String, Integer> getAllReadyTasks();  }