@ManagedAttribute( description = "Purge flows older than given duration " + "(e.g. \"30d\" will purge flows older than 30 days)") public void setPurgeFlowsOlderThan(String purgeFlowsOlderThan) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setPurgeFlowsOlderThan(formatInput(purgeFlowsOlderThan)); flowManager.mergeApplicationConfig(applicationConfig); }
@ManagedAttribute( description = "Set to true to exclude ERROR flows from being purged. " + "Set to false to purge CLEAN and ERROR flows") public void setDoNotPurgeErrorFlows(boolean doNotPurgeErrorFlows) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setDoNotPurgeErrorFlows(doNotPurgeErrorFlows); flowManager.mergeApplicationConfig(applicationConfig); }
private FlowPurgeJob getFlowPurgeJob(ApplicationConfig config) { FlowPurgeJob flowPurgeJob = flowPurgeJobs.get(config.getApplication()); if (flowPurgeJob == null) { flowPurgeJob = new FlowPurgeJob(flowManager, scheduler, application); flowPurgeJob.setFlowPurgeSchedule(config.getFlowPurgeSchedule()); flowPurgeJob.setPurgeFlowsOlderThan(config.getPurgeFlowsOlderThan()); flowPurgeJob.setDoNotPurgeErrorFlows(config.isDoNotPurgeErrorFlows()); flowPurgeJobs.put(application, flowPurgeJob); } return flowPurgeJob; }
private void initJobs() { LOG.info("Initialize flow purge jobs ... "); for (ApplicationConfig config : flowManager.findApplicationConfigs()) { if (config.isFlowPurgeScheduled()) { scheduleJob(config); } else { LOG.info("Skip scheduling of job for application " + config.getApplication()); } } LOG.info("Initialization done. "); }
@ManagedAttribute(description = "Cron expression for purge schedule") public void setPurgeSchedule(String purgeSchedule) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setFlowPurgeSchedule(formatInput(purgeSchedule)); flowManager.mergeApplicationConfig(applicationConfig); }