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 HandlerKeyhandlerKeyprotected List<QueueProcessor<T>>processorTasksprotected com.google.common.util.concurrent.RateLimiterreportRateLimiterprotected Supplier<Long>timeProviderprotected Timertimer
-
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 voidrun()voidstart()Starts the process.voidstop()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 ofQueueProcessortasks responsible for processing the backlog.backlogSizeSink- Where to report backlog size.
-
-
Method Detail
-
start
public void start()
Description copied from interface:ManagedStarts the process.
-
-