Package com.wavefront.agent.queueing
Class QueueController<T extends DataSubmissionTask<T>>
- java.lang.Object
-
- java.util.TimerTask
-
- com.wavefront.agent.queueing.QueueController<T>
-
- Type Parameters:
T
- submission task type
public class QueueController<T extends DataSubmissionTask<T>> extends TimerTask implements Managed
A queue controller (one per entity/port). Responsible for reporting queue-related metrics and adjusting priority across queues.- Author:
- [email protected]
-
-
Field Summary
Fields Modifier and Type Field Description protected HandlerKey
handlerKey
protected List<QueueProcessor<T>>
processorTasks
protected com.google.common.util.concurrent.RateLimiter
reportRateLimiter
protected Supplier<Long>
timeProvider
protected Timer
timer
-
Constructor Summary
Constructors Constructor Description QueueController(HandlerKey handlerKey, List<QueueProcessor<T>> processorTasks, Consumer<Integer> backlogSizeSink)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
void
start()
Starts the process.void
stop()
Stops the process.-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Field Detail
-
handlerKey
protected final HandlerKey handlerKey
-
processorTasks
protected final List<QueueProcessor<T extends DataSubmissionTask<T>>> processorTasks
-
timer
protected final Timer timer
-
reportRateLimiter
protected final com.google.common.util.concurrent.RateLimiter reportRateLimiter
-
-
Constructor Detail
-
QueueController
public QueueController(HandlerKey handlerKey, List<QueueProcessor<T>> processorTasks, @Nullable Consumer<Integer> backlogSizeSink)
- Parameters:
handlerKey
- Pipeline handler keyprocessorTasks
- List ofQueueProcessor
tasks responsible for processing the backlog.backlogSizeSink
- Where to report backlog size.
-
-
Method Detail
-
start
public void start()
Description copied from interface:Managed
Starts the process.
-
-