Constructor and Description |
---|
KafkaScheduler(int threads) |
KafkaScheduler(int threads,
boolean daemon) |
KafkaScheduler(int threads,
boolean daemon,
boolean trackStuckIO) |
KafkaScheduler(int threads,
boolean daemon,
String threadNamePrefix,
boolean trackStuckIO) |
Modifier and Type | Method and Description |
---|---|
boolean |
isStarted() |
void |
resizeThreadPool(int newSize) |
ScheduledFuture<?> |
schedule(String name,
Runnable task,
long delayMs,
long periodMs)
Schedule a task.
|
void |
shutdown()
Shutdown this scheduler.
|
int |
size()
Returns the number of pending tasks.
|
void |
startup()
Initialize this scheduler so it is ready to accept scheduling of tasks
|
boolean |
taskRunning(ScheduledFuture<?> task) |
String |
threadNamePrefix() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
scheduleOnce, scheduleOnce
public KafkaScheduler(int threads)
public KafkaScheduler(int threads, boolean daemon)
public KafkaScheduler(int threads, boolean daemon, boolean trackStuckIO)
public KafkaScheduler(int threads, boolean daemon, String threadNamePrefix, boolean trackStuckIO)
public void startup()
Scheduler
public void shutdown() throws InterruptedException
Scheduler
shutdown
in interface Scheduler
InterruptedException
public ScheduledFuture<?> schedule(String name, Runnable task, long delayMs, long periodMs)
Scheduler
schedule
in interface Scheduler
name
- The name of this tasktask
- The task to rundelayMs
- The number of milliseconds to wait before the first executionperiodMs
- The period in milliseconds with which to execute the task. If periodMs
is less than 0
the task will execute only once.public final boolean isStarted()
public void resizeThreadPool(int newSize)
resizeThreadPool
in interface Scheduler
public int size()
Scheduler
public String threadNamePrefix()
public boolean taskRunning(ScheduledFuture<?> task)