Class ScheduledExecutors
- java.lang.Object
-
- org.apache.druid.java.util.common.concurrent.ScheduledExecutors
-
public class ScheduledExecutors extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScheduledExecutors.Signal
-
Constructor Summary
Constructors Constructor Description ScheduledExecutors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScheduledExecutorFactory
createFactory(Lifecycle lifecycle)
static ScheduledExecutorService
fixed(int corePoolSize, String nameFormat)
static void
scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration rate, Callable<ScheduledExecutors.Signal> callable)
static void
scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration period, Runnable runnable)
Run runnable once every period, after the given initial delay.static void
scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration rate, Callable<ScheduledExecutors.Signal> callable)
static void
scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration delay, Callable<ScheduledExecutors.Signal> callable)
Run callable repeatedly with the given delay between calls, after the given initial delay, until it returns Signal.STOP.static void
scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration delay, Runnable runnable)
Run runnable repeatedly with the given delay between calls, after the given initial delay.static void
scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration delay, Callable<ScheduledExecutors.Signal> callable)
Run callable repeatedly with the given delay between calls, until it returns Signal.STOP.
-
-
-
Method Detail
-
scheduleWithFixedDelay
public static void scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration delay, Runnable runnable)
Run runnable repeatedly with the given delay between calls, after the given initial delay. Exceptions are caught and logged as errors.
-
scheduleWithFixedDelay
public static void scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration delay, Callable<ScheduledExecutors.Signal> callable)
Run callable repeatedly with the given delay between calls, after the given initial delay, until it returns Signal.STOP. Exceptions are caught and logged as errors.
-
scheduleWithFixedDelay
public static void scheduleWithFixedDelay(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration delay, Callable<ScheduledExecutors.Signal> callable)
Run callable repeatedly with the given delay between calls, until it returns Signal.STOP. Exceptions are caught and logged as errors.
-
scheduleAtFixedRate
public static void scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration period, Runnable runnable)
Run runnable once every period, after the given initial delay. Exceptions are caught and logged as errors.
-
scheduleAtFixedRate
public static void scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration rate, Callable<ScheduledExecutors.Signal> callable)
-
scheduleAtFixedRate
public static void scheduleAtFixedRate(ScheduledExecutorService exec, org.joda.time.Duration initialDelay, org.joda.time.Duration rate, Callable<ScheduledExecutors.Signal> callable)
-
createFactory
public static ScheduledExecutorFactory createFactory(Lifecycle lifecycle)
-
fixed
public static ScheduledExecutorService fixed(int corePoolSize, String nameFormat)
-
-