public class DisruptorQueue extends Object implements IStatefulObject
A single consumer queue that uses the LMAX Disruptor. They key to the performance is the ability to catch up to the producer by processing tuples in batches.
Modifier and Type | Class and Description |
---|---|
class |
DisruptorQueue.QueueMetrics
This inner class provides methods to access the metrics of the disruptor queue.
|
Constructor and Description |
---|
DisruptorQueue(String queueName,
com.lmax.disruptor.dsl.ProducerType type,
int size,
long readTimeout,
int inputBatchSize,
long flushInterval,
String topologyId,
String componentId,
Integer taskId,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
consumeBatch(com.lmax.disruptor.EventHandler<Object> handler) |
void |
consumeBatchWhenAvailable(com.lmax.disruptor.EventHandler<Object> handler) |
int |
getHighWaterMark() |
int |
getLowWaterMark() |
DisruptorQueue.QueueMetrics |
getMetrics() |
String |
getName() |
Object |
getState() |
boolean |
getThrottleOn() |
void |
haltWithInterrupt() |
boolean |
isFull() |
void |
publish(Object obj) |
void |
registerBackpressureCallback(DisruptorBackpressureCallback cb) |
DisruptorQueue |
setEnableBackpressure(boolean enableBackpressure) |
DisruptorQueue |
setHighWaterMark(double highWaterMark) |
DisruptorQueue |
setLowWaterMark(double lowWaterMark) |
public String getName()
public boolean isFull()
public void haltWithInterrupt()
public void consumeBatch(com.lmax.disruptor.EventHandler<Object> handler)
public void consumeBatchWhenAvailable(com.lmax.disruptor.EventHandler<Object> handler)
public void registerBackpressureCallback(DisruptorBackpressureCallback cb)
public void publish(Object obj)
public Object getState()
getState
in interface IStatefulObject
public DisruptorQueue setHighWaterMark(double highWaterMark)
public DisruptorQueue setLowWaterMark(double lowWaterMark)
public int getHighWaterMark()
public int getLowWaterMark()
public DisruptorQueue setEnableBackpressure(boolean enableBackpressure)
public boolean getThrottleOn()
public DisruptorQueue.QueueMetrics getMetrics()
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.