| 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, waitscheduleOnce, scheduleOncepublic 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()
Schedulerpublic void shutdown()
throws InterruptedException
Schedulershutdown in interface SchedulerInterruptedExceptionpublic ScheduledFuture<?> schedule(String name, Runnable task, long delayMs, long periodMs)
Schedulerschedule in interface Schedulername - 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 Schedulerpublic int size()
Schedulerpublic String threadNamePrefix()
public boolean taskRunning(ScheduledFuture<?> task)