@Test public void testGetJobs() throws Exception { JobConfigManager jcm = getJobConfigManager(); jcm.addJob(new ZnodeJob("foo")); jcm.addJob(new ZnodeJob("bar")); new JobConfigManager(spawnDataStore); }
public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } }
JobConfigManager { public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } } }
JobConfigManager { public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } } @Deprecated  JobConfigManager(SpawnDataStore spawnDataStore);  JobConfigManager(SpawnDataStore spawnDataStore, JobExpander jobExpander); }
JobConfigManager { public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } } @Deprecated  JobConfigManager(SpawnDataStore spawnDataStore);  JobConfigManager(SpawnDataStore spawnDataStore, JobExpander jobExpander); String getExpandedConfig(String jobUUID); String getExpandedConfig(String rawConfig, Collection<JobParameter> parameters); void writeUpdateIfDataNotNull(String path, String data); void addJob(IJob ijob); void updateJob(IJob ijob); IJob getJob(String jobId); String getConfig(String jobUUID); void setConfig(String jobId, String config); @Scaling(SETUP) Map<String, IJob> loadJobs(); void deleteJob(String jobUUID); }
JobConfigManager { public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } } @Deprecated  JobConfigManager(SpawnDataStore spawnDataStore);  JobConfigManager(SpawnDataStore spawnDataStore, JobExpander jobExpander); String getExpandedConfig(String jobUUID); String getExpandedConfig(String rawConfig, Collection<JobParameter> parameters); void writeUpdateIfDataNotNull(String path, String data); void addJob(IJob ijob); void updateJob(IJob ijob); IJob getJob(String jobId); String getConfig(String jobUUID); void setConfig(String jobId, String config); @Scaling(SETUP) Map<String, IJob> loadJobs(); void deleteJob(String jobUUID);  }