예제 #1
0
 @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);
 }
예제 #2
0
 @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);
 }
예제 #3
0
 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;
 }
예제 #4
0
 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. ");
 }
예제 #5
0
 @ManagedAttribute(description = "Cron expression for purge schedule")
 public void setPurgeSchedule(String purgeSchedule) {
   ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application);
   applicationConfig.setFlowPurgeSchedule(formatInput(purgeSchedule));
   flowManager.mergeApplicationConfig(applicationConfig);
 }