Class Scheduler

  • All Implemented Interfaces:
    java.util.concurrent.ThreadFactory

    public final class Scheduler
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    Scheduler that starts the modules configured in collector.properties.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ACTIVATED  
      static java.lang.String OFFSETMIN  
      static java.lang.String PERIODMIN  
    • Method Detail

      • getInstance

        public static Scheduler getInstance()
      • scheduleModuleRuns

        public void scheduleModuleRuns​(java.util.Map<Key,​java.lang.Class<? extends CollecTorMain>> collecTorMains,
                                       Configuration conf)
        Schedule all classes given according to the parameters in the the configuration.
      • computeInitialDelayMillis

        protected static long computeInitialDelayMillis​(long currentMillis,
                                                        long offsetMillis,
                                                        long periodMillis)
      • shutdownScheduler

        public void shutdownScheduler()
        Try to shutdown smoothly, i.e., wait for running tasks to terminate.
      • newThread

        public java.lang.Thread newThread​(java.lang.Runnable runner)
        Provide a nice name for debugging and log thread creation.
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory