@Test public void assertAdd() { disableAppService.add("test_app"); verify(regCenter).isExisted("/state/disable/app/test_app"); verify(regCenter).persist("/state/disable/app/test_app", "test_app"); }
public void add(final String appName) { if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); if (!regCenter.isExisted(disableAppNodePath)) { regCenter.persist(disableAppNodePath, appName); } }
DisableAppService { public void add(final String appName) { if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); if (!regCenter.isExisted(disableAppNodePath)) { regCenter.persist(disableAppNodePath, appName); } } }
DisableAppService { public void add(final String appName) { if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); if (!regCenter.isExisted(disableAppNodePath)) { regCenter.persist(disableAppNodePath, appName); } } DisableAppService(final CoordinatorRegistryCenter regCenter); }
DisableAppService { public void add(final String appName) { if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); if (!regCenter.isExisted(disableAppNodePath)) { regCenter.persist(disableAppNodePath, appName); } } DisableAppService(final CoordinatorRegistryCenter regCenter); void add(final String appName); void remove(final String appName); boolean isDisabled(final String appName); }
DisableAppService { public void add(final String appName) { if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); return; } String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); if (!regCenter.isExisted(disableAppNodePath)) { regCenter.persist(disableAppNodePath, appName); } } DisableAppService(final CoordinatorRegistryCenter regCenter); void add(final String appName); void remove(final String appName); boolean isDisabled(final String appName);  }