Class RRMScheduler
- java.lang.Object
-
- com.facebook.openwifi.rrm.modules.RRMScheduler
-
public class RRMScheduler extends Object
RRM scheduler, implemented using Quartz.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RRMScheduler.RRMJob
RRM job.
-
Constructor Summary
Constructors Constructor Description RRMScheduler(RRMConfig.ModuleConfig.RRMSchedulerParams params, DeviceDataManager deviceDataManager)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String[]
parseIntoQuartzCron(String linuxCron)
Parses Linux cron spec (with seconds) into Quartz compatible cron spec.protected void
performRRM(String zone)
Run RRM algorithms for the given zone.void
shutdown()
Shut down the scheduler.boolean
start(ConfigManager configManager, Modeler modeler)
Start the scheduler, returning true if newly started.void
syncTriggers()
Synchronize triggers to the current topology, adding/updating/deleting them as necessary.
-
-
-
Constructor Detail
-
RRMScheduler
public RRMScheduler(RRMConfig.ModuleConfig.RRMSchedulerParams params, DeviceDataManager deviceDataManager)
Constructor.
-
-
Method Detail
-
parseIntoQuartzCron
public static String[] parseIntoQuartzCron(String linuxCron)
Parses Linux cron spec (with seconds) into Quartz compatible cron spec. Quartz does not allow setting both day of week and day of month. If valid Quartz cron already we don't need to do anything. Otherwise we can't use Quartz to even parse out the components as it will just throw a parse error.- Parameters:
linuxCron
- Linux cron with seconds (seconds minutes hours day_of_month month day_of_week [year])- Returns:
- String[] an array of length 1 or 2 of Quartz supported cron that's equivalent to the original linux cron
- Throws:
IllegalArgumentException
- when a linux cron cannot be parsed into a valid Quartz spec
-
start
public boolean start(ConfigManager configManager, Modeler modeler)
Start the scheduler, returning true if newly started.
-
shutdown
public void shutdown()
Shut down the scheduler.
-
syncTriggers
public void syncTriggers()
Synchronize triggers to the current topology, adding/updating/deleting them as necessary. This updatesscheduledJobKeys
.
-
performRRM
protected void performRRM(String zone)
Run RRM algorithms for the given zone.
-
-